当前位置: 首页>>代码示例>>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;未经允许,请勿转载。