本文整理汇总了PHP中Department::getAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Department::getAll方法的具体用法?PHP Department::getAll怎么用?PHP Department::getAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Department
的用法示例。
在下文中一共展示了Department::getAll方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testSave
function testSave()
{
//Arrange
$name = "Math";
$id = 1;
$test_department = new Department($name, $id);
$test_department->save();
//Act
$result = Department::getAll();
//Assert
$this->assertEquals($test_department, $result[0]);
}
示例2: find
static function find($search_id)
{
$found_department = null;
$department = Department::getAll();
foreach ($department as $department) {
$department_id = $department->getId();
if ($department_id == $search_id) {
$found_department = $department;
}
}
return $found_department;
}
示例3: find
static function find($search_id)
{
$found_department = null;
$all_deps = Department::getAll();
foreach ($all_deps as $dep) {
if ($dep->getId() == $search_id) {
$found_department = $dep;
}
}
return $found_department;
}
示例4: setCharSet
require_once $root_path . 'include/care_api_classes/class_department.php';
require_once $root_path . 'include/inc_config_color.php';
// load color preferences
$breakfile = 'nursing.php?sid=' . $sid . '&lang=' . $lang;
if ($pday == '') {
$pday = date('d');
}
if ($pmonth == '') {
$pmonth = date('m');
}
if ($pyear == '') {
$pyear = date('Y');
}
$t_date = $pday . '.' . $pmonth . '.' . $pyear;
$dept_obj = new Department();
$deptarray = $dept_obj->getAll();
$depttypes = $dept_obj->getTypes();
$dept = $dept_obj->getDeptAllInfo($dept_nr);
while (list($x, $v) = each($dept)) {
${$x} = $v;
}
$dept_info = $dept_obj->getTypeInfo($dept['type']);
?>
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.0//EN" "html.dtd">
<HTML>
<HEAD>
<?php
echo setCharSet();
?>
示例5: test_delete
function test_delete()
{
//Arrange
$name = "Biology";
$address = "346 Stupid Avenue";
$test_department = new Department($name, $address);
$test_department->save();
$name2 = "Chemiology";
$address2 = "55 Bo Ct";
$test_department2 = new Department($name2, $address2);
$test_department2->save();
//Act
$test_department->delete();
//Assert
$result = Department::getAll();
$this->assertEquals([$test_department2], $result);
}
示例6: basename
* elpidio@care2x.org,
*
* See the file "copy_notice.txt" for the licence notice
*/
$thisfile = basename($_SERVER['PHP_SELF']);
if (!isset($mode)) {
$mode = 'show';
} elseif ($mode == 'create' || $mode == 'update') {
}
$lang_tables = array('departments.php');
require './include/init_show.php';
if ($parent_admit) {
$sql = "SELECT dr.*, e.encounter_class_nr FROM care_encounter AS e, care_person AS p, care_encounter_diagnostics_report AS dr \n\t\tWHERE p.pid=" . $_SESSION['sess_pid'] . " \n\t\t\tAND p.pid=e.pid \n\t\t\tAND e.encounter_nr=" . $_SESSION['sess_en'] . " \n\t\t\tAND e.encounter_nr=dr.encounter_nr \n\t\tORDER BY dr.create_time DESC";
} else {
$sql = "SELECT dr.*, e.encounter_class_nr FROM care_encounter AS e, care_person AS p, care_encounter_diagnostics_report AS dr \n\t\tWHERE p.pid=" . $_SESSION['sess_pid'] . " AND p.pid=e.pid AND e.encounter_nr=dr.encounter_nr \n\t\tORDER BY dr.create_time DESC";
}
if ($result = $db->Execute($sql)) {
$rows = $result->RecordCount();
include_once $root_path . 'include/care_api_classes/class_department.php';
$dept_obj = new Department();
$depts_array =& $dept_obj->getAll();
} else {
echo $sql;
}
$subtitle = $LDDiagXResults;
$notestype = 'diagnostics';
$_SESSION['sess_file_return'] = $thisfile;
$buffer = str_replace('~tag~', $title . ' ' . $name_last, $LDNoRecordFor);
$norecordyet = str_replace('~obj~', strtolower($subtitle), $buffer);
/* Load GUI page */
require './gui_bridge/default/gui_show.php';