Example #1
0
 /**
  * @param \Generated\Shared\Transfer\CmsBlockTransfer $cmsBlockTransfer
  *
  * @return array
  */
 public function getBlockByName(CmsBlockTransfer $cmsBlockTransfer)
 {
     $blockName = $cmsBlockTransfer->getName() . '-' . $cmsBlockTransfer->getType() . '-' . $cmsBlockTransfer->getValue();
     $key = $this->keyBuilder->generateKey($blockName, $cmsBlockTransfer->getLocale()->getLocaleName());
     $block = $this->storage->get($key);
     return $block;
 }
Example #2
0
 /**
  * @param \Generated\Shared\Transfer\CmsBlockTransfer $cmsBlockTransfer
  * @param \Orm\Zed\Cms\Persistence\SpyCmsBlock $blockEntity
  *
  * @return void
  */
 protected function touchKeyChangeNecessary(CmsBlockTransfer $cmsBlockTransfer, SpyCmsBlock $blockEntity)
 {
     $blockName = $this->getCmsBlockKey($blockEntity->getName(), $blockEntity->getType(), $blockEntity->getValue());
     $newBlockName = $this->getCmsBlockKey($cmsBlockTransfer->getName(), $cmsBlockTransfer->getType(), $cmsBlockTransfer->getValue());
     if ($blockName !== $newBlockName) {
         $cmsBlockTransfer->setIdCmsBlock($blockEntity->getIdCmsBlock());
         $this->touchBlockActiveWithKeyChange($cmsBlockTransfer);
     } else {
         $this->touchBlockActive($cmsBlockTransfer);
     }
 }