return NewsInterface::class; | return NewsInterface::class; | ||||
} | } | ||||
public function findLastNewsHome() | |||||
public function findLatests($maxResults = 0) | |||||
{ | { | ||||
return $this->findByMerchantQuery() | |||||
->orderBy('e.date', 'DESC') | |||||
->setMaxResults(2) | |||||
->getQuery() | |||||
->getResult(); | |||||
$result = $this->findByMerchantQuery() | |||||
->orderBy('e.date', 'DESC') ; | |||||
if($maxResults) { | |||||
$result->setMaxResults($maxResults) ; | |||||
} | |||||
return $result->getQuery()->getResult() ; | |||||
} | } | ||||
} | } |