/**
  * @return array
  */
 protected function getBlocks()
 {
     $blocks = [];
     $blockEntities = $this->queryContainer->queryBlock()->find();
     foreach ($blockEntities as $blockEntity) {
         $blocks[$blockEntity->getIdCmsBlock()] = $blockEntity->getName();
     }
     return $blocks;
 }
 /**
  * @param int $idCmsBlock
  * @param bool $decode
  *
  * @throws \Pav\Zed\CmsBlock\Business\Exception\CmsBlockNotFoundException
  * @return array
  */
 protected function getLocalizedBlocks($idCmsBlock, $decode = true)
 {
     $cmsBlock = $this->queryContainer->queryBlockWithLocalized($idCmsBlock)->find()->getFirst();
     if ($cmsBlock === null) {
         throw new CmsBlockNotFoundException(sprintf('CmsBlock not found id: %s', $idCmsBlock));
     }
     $formattedLocalizedBlocks = [];
     $formattedLocalizedBlocks = $this->formatLocalizedBlocks($cmsBlock, $formattedLocalizedBlocks, $decode);
     $formattedLocalizedBlocks = $this->formatMissingLocales($cmsBlock, $formattedLocalizedBlocks);
     return $formattedLocalizedBlocks;
 }
 /**
  * @param int|null $idCmsBlock
  *
  * @throws \Pav\Zed\CmsBlock\Business\Exception\CmsBlockNotFoundException
  * @return array
  */
 public function getData($idCmsBlock = null)
 {
     if ($idCmsBlock === null) {
         return [];
     }
     $cmsBlock = $this->queryContainer->queryCmsBlockById($idCmsBlock)->findOne();
     if ($cmsBlock === null) {
         throw new CmsBlockNotFoundException(sprintf('CmsBlock not found id: %s', $idCmsBlock));
     }
     return [CmsBlockForm::FIELD_ID_CMS_BLOCK => $idCmsBlock, CmsBlockForm::FIELD_NAME => $cmsBlock->getName(), CmsBlockForm::FIELD_TEMPLATE_TYPE => $cmsBlock->getTemplateType()];
 }
 /**
  * @param int $idCmsBlock
  *
  * @return void
  */
 protected function touchLinkedPages($idCmsBlock)
 {
     $pageBlocks = $this->queryContainer->queryPageBlockByIdBlock($idCmsBlock)->find();
     if (count($pageBlocks) > 0) {
         foreach ($pageBlocks as $pageBlock) {
             $this->touchPage($pageBlock->getFkPage());
         }
     }
 }