예제 #1
0
 /**
  * @param \Orm\Zed\Cms\Persistence\SpyCmsBlock $cmsBlockEntity
  *
  * @return void
  */
 protected function deleteBlockWithRelations(SpyCmsBlock $cmsBlockEntity)
 {
     $spyCmsPage = $cmsBlockEntity->getSpyCmsPage();
     $spyCmsPage->getSpyCmsGlossaryKeyMappings()->delete();
     $spyCmsPage->delete();
     $cmsBlockEntity->delete();
 }
예제 #2
0
 /**
  * @param \Orm\Zed\Cms\Persistence\SpyCmsBlock $blockEntity
  *
  * @return \Generated\Shared\Transfer\CmsBlockTransfer
  */
 protected function createBlockTransfer(SpyCmsBlock $blockEntity)
 {
     $blockTransfer = new CmsBlockTransfer();
     $blockTransfer->fromArray($blockEntity->toArray());
     return $blockTransfer;
 }
예제 #3
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);
     }
 }