synchronizeCustomLayout() public static method

Synchronizes a custom layout with its master layout
public static synchronizeCustomLayout ( CustomLayout $customLayout )
$customLayout Pimcore\Model\Object\ClassDefinition\CustomLayout
コード例 #1
0
 /**
  * @param $id
  * @return mixed|null|CustomLayout
  * @throws \Exception
  */
 public static function getById($id)
 {
     if ($id === null) {
         throw new \Exception("CustomLayout id is null");
     }
     $cacheKey = "customlayout_" . $id;
     try {
         $customLayout = \Zend_Registry::get($cacheKey);
         if (!$customLayout) {
             throw new \Exception("Custom Layout in registry is null");
         }
     } catch (\Exception $e) {
         try {
             $customLayout = new self();
             $customLayout->getDao()->getById($id);
             Object\Service::synchronizeCustomLayout($customLayout);
             \Zend_Registry::set($cacheKey, $customLayout);
         } catch (\Exception $e) {
             \Logger::error($e);
             return null;
         }
     }
     return $customLayout;
 }