getAcl()->check($this->name, 'read')) { throw new Forbidden(); } $where = $request->get('where'); $parentId = $request->get('parentId'); $maxDepth = $request->get('maxDepth'); $onlyNotEmpty = $request->get('onlyNotEmpty'); $collection = $this->getRecordService()->getTree($parentId, [ 'where' => $where, 'onlyNotEmpty' => $onlyNotEmpty ], 0, $maxDepth); return (object) [ 'list' => $collection->toArray(), 'path' => $this->getRecordService()->getTreeItemPath($parentId), ]; } public function getActionLastChildrenIdList($params, $data, $request) { if (!$this->getAcl()->check($this->name, 'read')) { throw new Forbidden(); } $parentId = $request->get('parentId'); return $this->getRecordService()->getLastChildrenIdList($parentId); } }