Admin_ClassController::objectbrickListAction PHP Метод

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

    public function objectbrickListAction()
    {
        $list = new Object\Objectbrick\Definition\Listing();
        $list = $list->load();
        if ($this->hasParam("class_id") && $this->hasParam("field_name")) {
            $filteredList = [];
            $classId = $this->getParam("class_id");
            $fieldname = $this->getParam("field_name");
            foreach ($list as $type) {
                /** @var  $type Object\Objectbrick\Definition */
                $clsDefs = $type->getClassDefinitions();
                if (!empty($clsDefs)) {
                    foreach ($clsDefs as $cd) {
                        if ($cd["classname"] == $classId && $cd["fieldname"] == $fieldname) {
                            $filteredList[] = $type;
                            continue;
                        }
                    }
                }
                $layout = $type->getLayoutDefinitions();
                Object\Service::enrichLayoutDefinition($layout);
                $type->setLayoutDefinitions($layout);
            }
            $list = $filteredList;
        }
        $returnValueContainer = new Model\Tool\Admin\EventDataContainer($list);
        \Pimcore::getEventManager()->trigger("admin.class.objectbrickList.preSendData", $this, ["returnValueContainer" => $returnValueContainer, "objectId" => $this->getParam('object_id')]);
        $this->_helper->json(["objectbricks" => $list]);
    }