예제 #1
0
 /**
  * Prepare next and previous news
  *
  * @param \XLite\Module\XC\News\Model\NewsMessage $model Model to prepare
  *
  * @return array
  */
 public function findSiblingsByNews(\XLite\Module\XC\News\Model\NewsMessage $model)
 {
     return array($this->createQueryBuilder()->andWhere('n.date < :date')->setParameter('date', $model->getDate())->setMaxResults(1)->getSingleResult(), $this->createQueryBuilder()->andWhere('n.date > :date')->setParameter('date', $model->getDate())->setMaxResults(1)->getSingleResult());
 }
 /**
  * {@inheritDoc}
  */
 public function getDate()
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'getDate', array());
     return parent::getDate();
 }