当前位置: 首页>>代码示例>>PHP>>正文


PHP Roles::find_by_id方法代码示例

本文整理汇总了PHP中Roles::find_by_id方法的典型用法代码示例。如果您正苦于以下问题:PHP Roles::find_by_id方法的具体用法?PHP Roles::find_by_id怎么用?PHP Roles::find_by_id使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Roles的用法示例。


在下文中一共展示了Roles::find_by_id方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: findRole

 public function findRole($id)
 {
     $empRole = Roles::find_by_id($id);
     if ($empRole) {
         return $empRole;
         //print_r($empRole);
     } else {
         return false;
     }
 }
开发者ID:runningjack,项目名称:RobertJohnson,代码行数:10,代码来源:employees_model.php

示例2: delete

 public function delete($id)
 {
     $article = Roles::find_by_id($id);
     if ($article->delete()) {
         return true;
     }
 }
开发者ID:runningjack,项目名称:RobertJohnson,代码行数:7,代码来源:role_model.php

示例3: UpdateEmpRole

 /**
  * this section is required 
  * to update employee role
  */
 public function UpdateEmpRole()
 {
     $rEmployee = Employee::find_by_id($_POST['empid']);
     $rEmployee->emp_post = $_POST['emppost'];
     $rEmployee->emp_dept = $_POST['empdept'];
     $empDept = Department::find_by_id($_POST['empdept']);
     $Tlog = new Transaction();
     $Tlog->com_id = $empDept->dept_code;
     $Tlog->trans_type = "HR DEPARTMENT";
     $Tlog->trans_description = "Employee assigned to " . $empDept->dept_name . " Department";
     $Tlog->datecreated = date("Y-m-d H:i:s");
     $Tlog->user_id = $_SESSION['emp_ident'];
     $empRole = Roles::find_by_id($_POST['emppost']);
     $Tlog2 = new Transaction();
     $Tlog2->com_id = $empRole->main_id;
     $Tlog2->trans_type = "HR DEPARTMENT";
     $Tlog2->trans_description = "Employee assigned " . $empRole->role_name . " Role";
     $Tlog2->datecreated = date("Y-m-d H:i:s");
     $Tlog2->user_id = $_SESSION['emp_ident'];
     if ($rEmployee->update()) {
         $Tlog2->create();
         $Tlog->create();
         return true;
     } else {
         return false;
     }
 }
开发者ID:runningjack,项目名称:RobertJohnson,代码行数:31,代码来源:employees_model.php


注:本文中的Roles::find_by_id方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。