opensupports/server/models/Department.php

27 lines
645 B
PHP
Raw Normal View History

<?php
use RedBeanPHP\Facade as RedBean;
class Department extends DataStore {
const TABLE = 'department';
public static function getProps() {
return [
'name',
2016-12-08 03:43:32 +01:00
'sharedTicketList',
];
}
public static function getDepartmentNames() {
$departmentsList = RedBean::findAll(Department::TABLE);
$departmentsNameList = [];
foreach($departmentsList as $department) {
2016-11-21 03:01:38 +01:00
$departmentsNameList[] = [
'id' => $department->id,
'name' => $department->name
];
}
return $departmentsNameList;
}
}