Sulu\Bundle\CategoryBundle\Controller\CategoryController::getChildrenAction PHP Метод

getChildrenAction() публичный Метод

This method is used by the husky datagrid to load children of a category. If request.flat is set, only the first level of the respective graph is returned in a flat format.
public getChildrenAction ( mixed $parentId, Request $request ) : Response
$parentId mixed
$request Symfony\Component\HttpFoundation\Request
Результат Symfony\Component\HttpFoundation\Response
    public function getChildrenAction($parentId, Request $request)
    {
        $locale = $this->getRequestParameter($request, 'locale', true);
        if ($request->get('flat') == 'true') {
            // check if parent exists
            $this->getCategoryManager()->findById($parentId);
            $list = $this->getListRepresentation($request, $locale, $parentId);
        } else {
            $entities = $this->getCategoryManager()->findChildrenByParentId($parentId);
            $categories = $this->getCategoryManager()->getApiObjects($entities, $locale);
            $list = new CollectionRepresentation($categories, self::$entityKey);
        }
        return $this->handleView($this->view($list, 200));
    }