當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Department::create方法代碼示例

本文整理匯總了PHP中Department::create方法的典型用法代碼示例。如果您正苦於以下問題:PHP Department::create方法的具體用法?PHP Department::create怎麽用?PHP Department::create使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Department的用法示例。


在下文中一共展示了Department::create方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: run

 public function run()
 {
     $faker = Faker::create();
     foreach (range(1, 10) as $index) {
         Department::create([]);
     }
 }
開發者ID:jarciga,項目名稱:Euler2015Alpha,代碼行數:7,代碼來源:DepartmentsTableSeeder.php

示例2: run

 public function run()
 {
     //$faker = Faker::create();
     //foreach(range(1, 10) as $index)
     //{
     Department::create(['name' => '采購', 'short_name' => 'CG', 'right' => '', 'parent_id' => 0, 'sort' => 0]);
     Department::create(['name' => '銷售', 'short_name' => 'XS', 'right' => '', 'parent_id' => 0, 'sort' => 0]);
     Department::create(['name' => '倉庫', 'short_name' => 'CK', 'right' => '', 'parent_id' => 0, 'sort' => 0]);
     Department::create(['name' => '財務', 'short_name' => 'CW', 'right' => '', 'parent_id' => 0, 'sort' => 0]);
     //}
 }
開發者ID:yanguanglan,項目名稱:sz,代碼行數:11,代碼來源:DepartmentsTableSeeder.php

示例3: run

 public function run()
 {
     $faker = Faker\Factory::create();
     DB::table('tickets')->truncate();
     DB::table('departments')->truncate();
     Department::create(array('name' => 'Support'));
     Department::create(array('name' => 'Sales'));
     for ($i = 0; $i < 60; $i++) {
         Ticket::create(array('user_id' => $faker->randomNumber(1, 20), 'department_id' => $faker->randomNumber(1, 2), 'title' => $faker->sentence, 'message' => $faker->paragraph, 'status' => $faker->randomElement(array('Open', 'Closed'))));
     }
 }
開發者ID:carriercomm,項目名稱:saaspanel,代碼行數:11,代碼來源:TicketsTableSeeder.php

示例4: store

 /**
  * Store a newly created department in storage.
  *
  * @return Response
  */
 public function store()
 {
     $validator = Validator::make($data = Input::all(), Department::$rules);
     if ($validator->fails()) {
         return Redirect::back()->withErrors($validator)->withInput();
     }
     $data['short_name'] = '';
     $data['parent_id'] = 0;
     $data['sort'] = 0;
     Department::create($data);
     return Redirect::route('admin.departments.index');
 }
開發者ID:yanguanglan,項目名稱:sz,代碼行數:17,代碼來源:DepartmentsController.php

示例5: store

 /**
  * Store a newly created department in storage.
  */
 public function store()
 {
     $validator = Validator::make($input = Input::all(), Department::rules());
     if ($validator->fails()) {
         return Redirect::back()->withErrors($validator)->withInput();
     }
     $dept = Department::create(['deptName' => $input['deptName']]);
     foreach ($input['designation'] as $index => $value) {
         if ($value == '') {
             continue;
         }
         Designation::firstOrCreate(['deptID' => $dept->id, 'designation' => $value]);
     }
     return Redirect::route('admin.departments.index')->with('success', "<strong>{$input['deptName']}</strong> Agregado correctamente....");
 }
開發者ID:rodrigopbel,項目名稱:ong,代碼行數:18,代碼來源:DepartmentsController.php

示例6: storeAction

 /**
  * Create a new department
  */
 public function storeAction()
 {
     $validation = Validator::make(Input::all(), Department::$rules);
     if (!$validation->passes()) {
         return Redirect::route('departments.create')->withInput()->withErrors($validation)->with('message', 'There were validation errors.');
     }
     /**
      * Check name duplicates
      */
     if (count(Department::where('name', Input::get('name'))->get())) {
         return Redirect::route('departments.create')->withInput()->with('message', 'This department already exists.');
     }
     $department = Department::create(Input::all());
     return Redirect::route('departments.show', $department->id);
 }
開發者ID:himor,項目名稱:testing,代碼行數:18,代碼來源:DepartmentController.php

示例7: doInsert

function doInsert()
{
    if (isset($_POST['save'])) {
        $NAME = $_POST['deptname'];
        $SHORTNAME = $_POST['shortname'];
        $ADDRESS = $_POST['address'];
        $EMAIL = $_POST['email'];
        $TELEPHONE = $_POST['telephone'];
        $WEBSITE = $_POST['website'];
        $SCHOOL = $_POST['school'];
        $department = new Department();
        $department->name = $NAME;
        $department->shortname = $SHORTNAME;
        $department->address = $ADDRESS;
        $department->email = $EMAIL;
        $department->telephone = $TELEPHONE;
        $department->website = $WEBSITE;
        $department->school_id = $SCHOOL;
    }
    if ($NAME == "") {
        message('Department name is required!', "error");
        redirect('index.php?view=add');
    } elseif ($SHORTNAME == "") {
        message('Short Name is required!', "error");
        redirect('index.php?view=add');
    } elseif ($ADDRESS == "") {
        message('Address is required!', "error");
        redirect('index.php?view=add');
    } elseif ($EMAIL == "") {
        message('Gender Name is required!', "error");
        redirect('index.php?view=add');
    } elseif ($TELEPHONE == "") {
        message(' Telephone is required!', "error");
        redirect('index.php?view=add');
    } elseif ($WEBSITE == "") {
        message('Website is required!', "error");
        redirect('index.php?view=add');
    } elseif ($SCHOOL == "") {
        message('School Name is required!', "error");
        redirect('index.php?view=add');
    } else {
        $department->create();
        message('New department addedd successfully!', "success");
        redirect('index.php?view=list');
    }
}
開發者ID:allybitebo,項目名稱:ucb,代碼行數:46,代碼來源:controller.php

示例8: create

 public function create()
 {
     if (isset($_POST['deptname']) && !empty($_POST['deptname'])) {
         $department = new Department();
         $department->dept_name = $_POST['deptname'];
         $department->dept_desc = $_POST['description'];
         $department->date_created = date('Y-m-d H:i:s');
         $department->dept_hod_name = $_POST['hod'];
         //$department->dept_hod_id    =   $_POST[''];
         $department->dept_code = Department::getID2("RJHD", "tbldept", $department->dept_name);
         if ($department->create()) {
             return 1;
         } else {
             return 2;
         }
     }
 }
開發者ID:runningjack,項目名稱:RobertJohnson,代碼行數:17,代碼來源:departments_model.php

示例9: run

 public function run()
 {
     DB::table('departments')->delete();
     $common_test_para = '<p class="desc-para">
                               簡介:婦科擁有先進的醫療設備和雄厚的技術力量。
                               設有不孕症、內窺鏡、婦科內分泌、婦科腫瘤、婦科炎症等專科門診。
                               常年開展各種婦科疾病的診治及手術,婦科腫瘤及診治手術達省內最先進水平。
                           </p>
                           <p class="desc-para">
                               科室現有一批從事婦科臨床工作多年的專業醫護人員隊伍,其中副高職以上專業技術人員3人。
                               全體醫務人員以人性化服務為宗旨開展各種微創治療,新式陰式手術及腹部手術腹腔鏡下,宮腔鏡下完成各種婦科疾病的治療。
                           </p>';
     Department::create(array('name' => '婦科', 'photo' => '/images/hospital/detail.png', 'icon' => '/images/hospital/0001@3x.png', 'description' => $common_test_para, 'hospital_id' => 1));
     Department::create(array('name' => '普通門診', 'photo' => '/images/hospital/detail.png', 'icon' => '/images/hospital/0002@3x.png', 'description' => $common_test_para, 'hospital_id' => 1));
     Department::create(array('name' => '乳腺科', 'photo' => '/images/hospital/detail.png', 'icon' => '/images/hospital/0003@3x.png', 'description' => $common_test_para, 'hospital_id' => 1));
     Department::create(array('name' => '新生兒科', 'photo' => '/images/hospital/detail.png', 'icon' => '/images/hospital/0004@3x.png', 'description' => $common_test_para, 'hospital_id' => 1));
     Department::create(array('name' => '兒外科', 'photo' => '/images/hospital/detail.png', 'icon' => '/images/hospital/0005@3x.png', 'description' => $common_test_para, 'hospital_id' => 1));
     Department::create(array('name' => '兒內科', 'photo' => '/images/hospital/detail.png', 'icon' => '/images/hospital/0006@3x.png', 'description' => $common_test_para, 'hospital_id' => 1));
     Department::create(array('name' => '分院兒內科', 'photo' => '/images/hospital/detail.png', 'icon' => '/images/hospital/0007@3x.png', 'description' => $common_test_para, 'hospital_id' => 1));
     Department::create(array('name' => '麻醉手術室', 'photo' => '/images/hospital/detail.png', 'icon' => '/images/hospital/0008@3x.png', 'description' => $common_test_para, 'hospital_id' => 1));
     Department::create(array('name' => '分院婦產科', 'photo' => '/images/hospital/detail.png', 'icon' => '/images/hospital/0009@3x.png', 'description' => $common_test_para, 'hospital_id' => 1));
 }
開發者ID:Jv-Juven,項目名稱:hospital-register-system,代碼行數:22,代碼來源:DepartmentTableSeeder.php

示例10: createDepartment

    /**

     * Create New Department link on the top section of the left pane allows you to create a root-level department.

     *

     * @param string $departmentName

     * @param string $parentUID

     * @return $result will return an object

     */

    public function createDepartment ($departmentName, $parentUID)

    {

        try {

            if (trim( $departmentName ) == '') {

                $result = new wsCreateDepartmentResponse( 25, G::loadTranslation( 'ID_DEPARTMENT_NAME_REQUIRED' ), '' );



                return $result;

            }



            $department = new Department();



            if (($parentUID != '') && ! ($department->existsDepartment( $parentUID ))) {

                $result = new wsCreateDepartmentResponse( 26, G::loadTranslation( 'ID_PARENT_DEPARTMENT_NOT_EXIST' ), $parentUID );



                return $result;

            }



            if ($department->checkDepartmentName( $departmentName, $parentUID )) {

                $result = new wsCreateDepartmentResponse( 27, G::loadTranslation( 'ID_DEPARTMENT_EXISTS' ), '' );



                return $result;

            }



            $row['DEP_TITLE'] = $departmentName;

            $row['DEP_PARENT'] = $parentUID;



            $departmentId = $department->create( $row );



            $data['DEPARTMENT_NAME'] = $departmentName;

            $data['PARENT_UID'] = $parentUID;

            $data['DEPARTMENT_NAME'] = $departmentName;



            $result = new wsCreateDepartmentResponse( 0, G::loadTranslation( 'ID_DEPARTMENT_CREATED_SUCCESSFULLY', SYS_LANG, $data ), $departmentId );



            return $result;

        } catch (Exception $e) {

            $result = wsCreateDepartmentResponse( 100, $e->getMessage(), '' );



            return $result;

        }

    }
開發者ID:nhenderson,項目名稱:processmaker,代碼行數:95,代碼來源:class.wsBase.php

示例11: run

 public function run()
 {
     Department::create(['name' => 'Administration Services', 'head_id' => 1]);
     Department::create(['name' => 'Accounting Services', 'head_id' => 2]);
     Department::create(['name' => 'Budget Services', 'head_id' => 3]);
 }
開發者ID:codeblues1516,項目名稱:godaddy,代碼行數:6,代碼來源:DepartmentsTableSeeder.php

示例12: Department

     break;
 case 'checkEditDepartmentName':
     $parent = $_REQUEST['parent'];
     $dep_name = $_REQUEST['name'];
     $dep_uid = $_REQUEST['uid'];
     $oDepartment = new Department();
     $checkVal = $oDepartment->checkDepartmentName($dep_name, $parent, $dep_uid);
     echo !$checkVal ? 'true' : 'false';
     break;
 case 'saveDepartment':
     $parent = $_REQUEST['parent'];
     $dep_name = $_REQUEST['name'];
     $newDepartment['DEP_PARENT'] = $parent;
     $newDepartment['DEP_TITLE'] = $dep_name;
     $oDept = new Department();
     $oDept->create($newDepartment);
     echo '{success: true}';
     break;
 case 'usersByDepartment':
     G::LoadClass('configuration');
     $sDepUid = $_REQUEST['DEP_UID'];
     $oCriteria = new Criteria('workflow');
     $oCriteria->addSelectColumn(UsersPeer::USR_UID);
     $oCriteria->addSelectColumn(UsersPeer::USR_USERNAME);
     $oCriteria->addSelectColumn(UsersPeer::USR_FIRSTNAME);
     $oCriteria->addSelectColumn(UsersPeer::USR_LASTNAME);
     $oCriteria->addSelectColumn(UsersPeer::USR_REPORTS_TO);
     $oCriteria->add(UsersPeer::USR_STATUS, 'CLOSED', Criteria::NOT_EQUAL);
     $oCriteria->add(UsersPeer::DEP_UID, $sDepUid);
     $oDataset = DepartmentPeer::doSelectRS($oCriteria);
     $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
開發者ID:bqevin,項目名稱:processmaker,代碼行數:31,代碼來源:departments_Ajax.php

示例13: Department

 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 * 
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * 
 * For more information, contact Colosa Inc, 2566 Le Jeune Rd., 
 * Coral Gables, FL, 33134, USA, or email info@colosa.com.
 * 
 */
if (($RBAC_Response = $RBAC->userCanAccess("PM_USERS")) != 1) {
    return $RBAC_Response;
}
require_once 'classes/model/Department.php';
$oDept = new Department();
$depRow = $_POST['form'];
if ($_POST['form']['DEP_UID'] === '') {
    unset($depRow['DEP_UID']);
    $oDept->create($depRow);
} else {
    //    $oDeptos->updateUsers($depRow);
    $oDept->update($depRow);
    $oDept->updateDepartmentManager($depRow['DEP_UID']);
}
開發者ID:emildev35,項目名稱:processmaker,代碼行數:31,代碼來源:departments_Save.php


注:本文中的Department::create方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。