EmployeesManager
in package
Class EmployeesManager
Tags
Table of Contents
- EMPLOYEE_ADD_EVENT = 'emp_employee_add_new_employee_event'
- EMPLOYEE_UPDATE_EVENT = 'emp_employee_update_employee_event'
- TABLE_NAME = 'emp_employees'
- COLUMN_ADDED_DT = 'added_dt'
- COLUMN_CREATED_DT = 'created_dt'
- COLUMN_EDITED_DT = 'edited_dt'
- COLUMN_EXTERNAL_ID = 'external_id'
- COLUMN_ID = 'id'
- COLUMN_POSITION_ID = 'position_id'
- COLUMN_STRUCTURE_ID = 'structure_id'
- COLUMN_TITLE = 'title'
- COLUMN_UUID = 'uuid'
- $database : Context
- $hookManager : ModelHooks
- __construct() : mixed
- add() : mixed
- Adds new employee.
- delete() : bool
- employeeIsRule() : bool
- find() : array<string|int, mixed>
- findEmployeeByAnyParams() : Selection
- Поиск работников по любому разным параметрам
- get() : Row|null
- getColumns() : array<string|int, mixed>
- getEmployeeByExternalId() : ActiveRow
- return employee by external_id
- getEmployeeByUuid() : Row
- return employee by uuid
- getEmployeeIdsWhereRules() : array<string|int, mixed>
- getEmployeeProperties() : array<string|int, mixed>
- Возвращает массив всех параметров работника
- getEmployeesByNumber() : array<string|int, Row>
- getTags() : array<string|int, mixed>
- remove() : bool
- update() : bool
- getMetaProperties() : array<string|int, mixed>
- Возвращает массив мета полей работников
- getPositions() : array<string|int, mixed>
- getStructureLevel() : array<string|int, mixed>
- getStructures() : array<string|int, mixed>
Constants
EMPLOYEE_ADD_EVENT
public
mixed
EMPLOYEE_ADD_EVENT
= 'emp_employee_add_new_employee_event'
EMPLOYEE_UPDATE_EVENT
public
mixed
EMPLOYEE_UPDATE_EVENT
= 'emp_employee_update_employee_event'
TABLE_NAME
public
mixed
TABLE_NAME
= 'emp_employees'
COLUMN_ADDED_DT
private
mixed
COLUMN_ADDED_DT
= 'added_dt'
COLUMN_CREATED_DT
private
mixed
COLUMN_CREATED_DT
= 'created_dt'
COLUMN_EDITED_DT
private
mixed
COLUMN_EDITED_DT
= 'edited_dt'
COLUMN_EXTERNAL_ID
private
mixed
COLUMN_EXTERNAL_ID
= 'external_id'
COLUMN_ID
private
mixed
COLUMN_ID
= 'id'
COLUMN_POSITION_ID
private
mixed
COLUMN_POSITION_ID
= 'position_id'
COLUMN_STRUCTURE_ID
private
mixed
COLUMN_STRUCTURE_ID
= 'structure_id'
COLUMN_TITLE
private
mixed
COLUMN_TITLE
= 'title'
COLUMN_UUID
private
mixed
COLUMN_UUID
= 'uuid'
Properties
$database
private
Context
$database
$hookManager
private
ModelHooks
$hookManager
Methods
__construct()
public
__construct(Context $database, ModelHooks $hookManager) : mixed
Parameters
- $database : Context
- $hookManager : ModelHooks
Return values
mixed —add()
Adds new employee.
public
add(string $title, int $structure_id[, string|null $external_id = null ][, null $user_name = null ][, DateTime|null $created_dt = null ]) : mixed
Parameters
- $title : string
- $structure_id : int
- $external_id : string|null = null
- $user_name : null = null
- $created_dt : DateTime|null = null
Tags
Return values
mixed —delete()
public
delete( $id[, mixed $user_name = null ]) : bool
Parameters
Tags
Return values
bool —employeeIsRule()
public
employeeIsRule(string $employee_id, string $sqlRules) : bool
Parameters
- $employee_id : string
- $sqlRules : string
Tags
Return values
bool —find()
public
find([mixed $structurePermissions = null ][, mixed $pages = null ][, mixed $pageLimit = null ]) : array<string|int, mixed>
Parameters
- $structurePermissions : mixed = null
- $pages : mixed = null
- $pageLimit : mixed = null
Return values
array<string|int, mixed> —findEmployeeByAnyParams()
Поиск работников по любому разным параметрам
public
findEmployeeByAnyParams(array<string|int, mixed> $params) : Selection
Parameters
- $params : array<string|int, mixed>
Return values
Selection —get()
public
get(mixed $id) : Row|null
Parameters
- $id : mixed
Return values
Row|null —getColumns()
public
static getColumns() : array<string|int, mixed>
Return values
array<string|int, mixed> —getEmployeeByExternalId()
return employee by external_id
public
getEmployeeByExternalId(string $externalId) : ActiveRow
Parameters
- $externalId : string
Return values
ActiveRow —getEmployeeByUuid()
return employee by uuid
public
getEmployeeByUuid(string $uuid) : Row
Parameters
- $uuid : string
Tags
Return values
Row —getEmployeeIdsWhereRules()
public
getEmployeeIdsWhereRules(string $sqlRules) : array<string|int, mixed>
Parameters
- $sqlRules : string
Return values
array<string|int, mixed> —getEmployeeProperties()
Возвращает массив всех параметров работника
public
getEmployeeProperties() : array<string|int, mixed>
Return values
array<string|int, mixed> —Массив параметров работника вместе с мета параметрами
getEmployeesByNumber()
public
getEmployeesByNumber(string $number) : array<string|int, Row>
Parameters
- $number : string
Return values
array<string|int, Row> —getTags()
public
getTags(mixed $emp_id) : array<string|int, mixed>
Parameters
- $emp_id : mixed
Return values
array<string|int, mixed> —remove()
public
remove(array<string|int, mixed> $ids[, string|null $user_name = null ]) : bool
Parameters
- $ids : array<string|int, mixed>
- $user_name : string|null = null
Tags
Return values
bool —update()
public
update(mixed $id, mixed $values[, mixed $user_name = null ]) : bool
Parameters
- $id : mixed
- $values : mixed
- $user_name : mixed = null
Tags
Return values
bool —getMetaProperties()
Возвращает массив мета полей работников
private
getMetaProperties() : array<string|int, mixed>
Return values
array<string|int, mixed> —['meta.name'=>'meta.title']
getPositions()
private
getPositions() : array<string|int, mixed>
Return values
array<string|int, mixed> —getStructureLevel()
private
getStructureLevel() : array<string|int, mixed>
Return values
array<string|int, mixed> —getStructures()
private
getStructures() : array<string|int, mixed>