|
- <?php
-
- namespace Lc\ShopBundle\Repository;
-
- use App\Entity\DocumentQuotation;
- use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
- use Doctrine\Common\Persistence\ManagerRegistry;
- use Lc\ShopBundle\Context\DefaultRepositoryInterface;
- use Lc\ShopBundle\Context\DocumentInterface;
-
-
- class DocumentRepository extends BaseRepository implements DefaultRepositoryInterface
- {
- public function getInterfaceClass()
- {
- return DocumentInterface::class;
- }
-
- public function findLastInvoice()
- {
- $query = $this->findByMerchantQuery();
- $query->orderBy('e.createdAt', 'DESC');
- $query->setMaxResults(1);
- return $query->getQuery()->getOneOrNullResult();
- }
- }
|