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


PHP Department::findFirst方法代碼示例

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


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

示例1: edit

 public static function edit($id, $data)
 {
     $info = Department::findFirst($id);
     if (!$info) {
         return false;
     }
     foreach ($data as $field => $value) {
         $info->{$field} = $value;
     }
     return $info->update();
 }
開發者ID:Crocodile26,項目名稱:php-1,代碼行數:11,代碼來源:Department.php

示例2: indexAction

 public function indexAction()
 {
     $auth = $this->session->get('auth');
     $user = Users::findFirst($auth['id']);
     if ($user == false) {
         $this->forward('index/index');
     }
     if ($auth['did'] != '' && $auth['did'] != 0) {
         $department = Department::findFirst($auth['did']);
     } else {
         $department->name = '北京銀泰財富中心';
     }
     $this->view->setVar("department", $department);
 }
開發者ID:lookingatsky,項目名稱:zhonghewanbang,代碼行數:14,代碼來源:InvoicesController.php

示例3: departmentAction

 public function departmentAction()
 {
     $departmentid = $this->request->get('departmentid');
     $department = Department::findFirst(array('conditions' => 'id=?1', 'bind' => array(1 => $departmentid)));
     $hospital = $department->Hospital;
     $this->tag->appendTitle($hospital->name . $department->name);
     $doctors = array();
     $k = 0;
     foreach ($department->Doctor as $item) {
         $k++;
         $doctors[$k] = $item;
     }
     $city = $hospital->City;
     $this->view->setVars(array('city' => $city, 'hospital' => $hospital, 'department' => $department, 'doctors' => $doctors));
 }
開發者ID:sify21,項目名稱:guahao,代碼行數:15,代碼來源:ReserveController.php


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