namespace Lc\CaracoleBundle\Repository\File; | namespace Lc\CaracoleBundle\Repository\File; | ||||
use Knp\Component\Pager\PaginatorInterface; | use Knp\Component\Pager\PaginatorInterface; | ||||
use Lc\CaracoleBundle\Model\Address\AddressInterface; | |||||
use Lc\CaracoleBundle\Repository\MerchantRepositoryQueryTrait; | use Lc\CaracoleBundle\Repository\MerchantRepositoryQueryTrait; | ||||
use Lc\SovBundle\Repository\AbstractRepositoryQuery; | use Lc\SovBundle\Repository\AbstractRepositoryQuery; | ||||
{ | { | ||||
parent::__construct($repository, 'r', $paginator); | parent::__construct($repository, 'r', $paginator); | ||||
} | } | ||||
public function filterByBuyerAddress(AddressInterface $buyerAddress) | |||||
{ | |||||
return $this | |||||
->andWhere('.buyerAddress = :buyerAddress') | |||||
->setParameter('buyerAddress', $buyerAddress); | |||||
} | |||||
} | } |
namespace Lc\CaracoleBundle\Repository\File; | namespace Lc\CaracoleBundle\Repository\File; | ||||
use App\Entity\Address\Address; | |||||
use Lc\CaracoleBundle\Repository\MerchantStoreTrait; | use Lc\CaracoleBundle\Repository\MerchantStoreTrait; | ||||
use Lc\SovBundle\Repository\AbstractStore; | use Lc\SovBundle\Repository\AbstractStore; | ||||
// @TODO : à écrire | // @TODO : à écrire | ||||
} | } | ||||
//findLastInvoice | |||||
// findLastInvoice | |||||
public function getOneLastInvoice() | public function getOneLastInvoice() | ||||
{ | { | ||||
$query = $this->query->create(); | $query = $this->query->create(); | ||||
return $query->findOne(); | return $query->findOne(); | ||||
} | } | ||||
public function getByBuyerAddress(Address $buyerAddress) | |||||
{ | |||||
$query = $this->query->create(); | |||||
$query | |||||
->filterByBuyerAddress($buyerAddress); | |||||
return $query->find(); | |||||
} | |||||
} | } |