/** * @param int $idPage * * @throws \Spryker\Zed\Cms\Business\Exception\MissingPageException * * @return void */ protected function checkPageExists($idPage) { if (!$this->cmsQueryContainer->queryPageById($idPage)->count() > 0) { throw new MissingPageException(sprintf('Tried to refer to a missing page with id %s', $idPage)); } }
/** * @param int $idPage * * @return bool */ protected function hasPageId($idPage) { $query = $this->cmsQueryContainer->queryPageById($idPage); return $query->count() > 0; }
/** * @param int $idCmsPage * * @return \Orm\Zed\Cms\Persistence\SpyCmsPage|null */ protected function findCmsPageEntity($idCmsPage) { $cmsPageEntity = $this->cmsQueryContainer->queryPageById($idCmsPage)->findOne(); return $cmsPageEntity; }