コード例 #1
0
ファイル: Page.php プロジェクト: kr-solutions/krcms-bundle
 /**
  * {@inheritDoc}
  */
 public function getPermalink($getTruePermalink = false)
 {
     if (false === $getTruePermalink && null !== $this->site && $this->site->getHomepage() === $this) {
         return null;
     }
     return $this->permalink;
 }
コード例 #2
0
 /**
  * {@inheritDoc}
  */
 public function getActivePagesFromSiteQB(SiteInterface $site)
 {
     $qb = $this->repository->createQueryBuilder('pages');
     if (null !== $site->getId()) {
         $qb->where('pages.site = :site');
         $qb->setParameter('site', $site);
         // Check if the page is active
         $qb->andWhere('pages.publishAt < CURRENT_TIMESTAMP() OR pages.publishAt IS NULL');
         $qb->andWhere('pages.publishTill > CURRENT_TIMESTAMP() OR pages.publishTill IS NULL');
         $qb->orderBy('pages.orderId', 'asc');
     }
     return $qb;
 }