/** * @param \Orm\Zed\Cms\Persistence\SpyCmsBlock $cmsBlockEntity * * @return void */ protected function deleteBlockWithRelations(SpyCmsBlock $cmsBlockEntity) { $spyCmsPage = $cmsBlockEntity->getSpyCmsPage(); $spyCmsPage->getSpyCmsGlossaryKeyMappings()->delete(); $spyCmsPage->delete(); $cmsBlockEntity->delete(); }
/** * @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; }
/** * @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); } }