|
123456789101112131415161718192021222324252627282930 |
- <?php
-
- namespace Lc\ShopBundle\Repository;
-
- use App\Entity\News;
- use Lc\ShopBundle\Context\DefaultRepositoryInterface;
- use Lc\ShopBundle\Context\NewsInterface;
-
- /**
- * @method News|null find($id, $lockMode = null, $lockVersion = null)
- * @method News|null findOneBy(array $criteria, array $orderBy = null)
- * @method News[] findAll()
- * @method News[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
- */
- class NewsRepository extends BaseRepository implements DefaultRepositoryInterface
- {
- public function getInterfaceClass()
- {
- return NewsInterface::class;
- }
-
- public function findLastNewsHome()
- {
- return $this->findByMerchantQuery()
- ->orderBy('e.date', 'DESC')
- ->setMaxResults(2)
- ->getQuery()
- ->getResult();
- }
- }
|