|
- <?php
-
- namespace Lc\ShopBundle\Repository;
-
- use App\Entity\News;
- use Lc\ShopBundle\Context\DefaultRepositoryInterface;
- use Lc\ShopBundle\Context\NewsInterface;
-
-
- class NewsRepository extends BaseRepository implements DefaultRepositoryInterface
- {
- public function getInterfaceClass()
- {
- return NewsInterface::class;
- }
-
- public function findLatests($maxResults = 0)
- {
- $result = $this->findByMerchantQuery()
- ->orderBy('e.date', 'DESC') ;
-
- if($maxResults) {
- $result->setMaxResults($maxResults) ;
- }
-
- return $result->getQuery()->getResult() ;
- }
- }
|