Browse Source

Refactoring services

packProduct
Guillaume 3 years ago
parent
commit
0c55186e6f
2 changed files with 21 additions and 1 deletions
  1. +8
    -0
      Repository/File/DocumentRepositoryQuery.php
  2. +13
    -1
      Repository/File/DocumentStore.php

+ 8
- 0
Repository/File/DocumentRepositoryQuery.php View File

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);
}
} }

+ 13
- 1
Repository/File/DocumentStore.php View File



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();
}

} }

Loading…
Cancel
Save