Pimcore\Model\Object\ClassDefinition\CustomLayout::setLayoutDefinitions PHP Method

setLayoutDefinitions() public method

public setLayoutDefinitions ( array $layoutDefinitions )
$layoutDefinitions array
    public function setLayoutDefinitions($layoutDefinitions)
    {
        $this->layoutDefinitions = $layoutDefinitions;
    }

Usage Example

示例#1
0
 /**
  * @param null $id
  * @throws \Exception
  */
 public function getById($id = null)
 {
     if (!$id) {
         $id = $this->model->getId();
     }
     $layoutRaw = $this->db->fetchRow("SELECT * FROM custom_layouts WHERE id = ?", $id);
     if ($layoutRaw["id"]) {
         $this->assignVariablesToModel($layoutRaw);
         $this->model->setLayoutDefinitions($this->getLayoutData());
     } else {
         throw new \Exception("Layout with ID " . $id . " doesn't exist");
     }
 }
All Usage Examples Of Pimcore\Model\Object\ClassDefinition\CustomLayout::setLayoutDefinitions