uawdijnntqw1x1x1
IP : 3.14.72.80
Hostname : axolotl
Kernel : Linux axolotl 4.9.0-13-amd64 #1 SMP Debian 4.9.228-1 (2020-07-05) x86_64
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
OS : Linux
PATH:
/
var
/
www
/
axolotl
/
data
/
www
/
yar.axolotls.ru
/
bitrix
/
modules
/
timeman
/
lib
/
controller
/
worktimerecord.php
/
/
<?php namespace Bitrix\Timeman\Controller; use Bitrix\Main\ArgumentException; use Bitrix\Main\Engine\Controller; use Bitrix\Main\Engine\ActionFilter\Scope; use Bitrix\Main\Engine\Response\DataType\Page; use Bitrix\Main\UI\PageNavigation; use Bitrix\Timeman\Model\Worktime\Record\WorktimeRecordCollection; use Bitrix\Timeman\Model\Worktime\Record\WorktimeRecordTable; use Bitrix\Timeman\Util\Form\Filter\Validator\NumberValidator; class WorktimeRecord extends Controller { protected function getDefaultPreFilters() { return array_merge( parent::getDefaultPreFilters(), [ new Scope(Scope::REST), ] ); } public function getAction($id) { $validator = (new NumberValidator())->configureIntegerOnly(true)->configureMin(1); if (!$validator->validate($id)->isSuccess()) { throw new ArgumentException('id must be integer, greater than 0'); } $record = WorktimeRecordTable::query() ->addSelect('*') ->where('ID', $id) ->fetchObject(); return $record ? $this->convertRecordFields($record) : []; } public function listAction(PageNavigation $pageNavigation, $select = [], $filter = [], $order = []) { foreach ($select as $field) { if (!WorktimeRecordTable::getEntity()->hasField($field)) { throw new ArgumentException('WorktimeRecord does not have field ' . htmlspecialcharsbx($field)); } } $select = empty($select) ? ['*'] : $select; $order = empty($order) ? ['ID' => 'DESC'] : $order; if (!in_array('ID', $select, true)) { $select[] = 'ID'; } /** @var WorktimeRecordCollection $records */ $records = WorktimeRecordTable::query() ->setSelect($select) ->setFilter($filter) ->setOffset($pageNavigation->getOffset()) ->setLimit($pageNavigation->getLimit()) ->setOrder($order) ->exec() ->fetchCollection(); $result = []; foreach ($records->getAll() as $record) { $result[] = $this->convertRecordFields($record); } return new Page('WORKTIME_RECORDS', $result, function () use ($filter) { return WorktimeRecordTable::getCount($filter); }); } private function convertRecordFields(\Bitrix\Timeman\Model\Worktime\Record\WorktimeRecord $record) { return $this->convertKeysToCamelCase($record->collectValues()); } }
/var/www/axolotl/data/www/yar.axolotls.ru/bitrix/modules/timeman/lib/controller/worktimerecord.php