本文整理汇总了PHP中Department::find_by_id方法的典型用法代码示例。如果您正苦于以下问题:PHP Department::find_by_id方法的具体用法?PHP Department::find_by_id怎么用?PHP Department::find_by_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Department
的用法示例。
在下文中一共展示了Department::find_by_id方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete
public function delete($id)
{
$article = Department::find_by_id($id);
if ($article->delete()) {
return true;
}
}
示例2: Carbon
<?php
require_once "inc/initialize.php";
require_once "inc/vendor/autoload.php";
use Carbon\Carbon;
// Instance of Carbon Class with the current time
$date_now = new Carbon('now');
if (!$session->is_logged_in()) {
header("location: index.php");
}
$user = User::find_by_id($session->id);
if (isset($user->programme_id)) {
$prog = Programme::find_by_id($user->programme_id);
}
if (isset($prog->department_id)) {
$dept = Department::find_by_id($prog->department_id);
}
if (isset($dept->faculty_id)) {
$fac = Faculty::find_by_id($dept->faculty_id);
}
?>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>University of Jos, Nigeria - Transcript System</title>
<?php
require_once LIB_PATH . DS . 'javascript.php';
require_once LIB_PATH . DS . 'css.php';
?>
<style type="text/css">
示例3: findDepartment
public function findDepartment($id)
{
$empDept = Department::find_by_id($id);
if ($empDept) {
return $empDept;
//print_r($empRole);
} else {
return false;
}
}
示例4: 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;
}
}