@@ -4,10 +4,13 @@ namespace Lc\CaracoleBundle\Repository\Address; | |||
use App\Entity\Address\Address; | |||
use Doctrine\Persistence\ManagerRegistry; | |||
use Lc\CaracoleBundle\Repository\MerchantRepositoryQueryTrait; | |||
use Lc\SovBundle\Repository\AbstractRepository; | |||
class AddressRepository extends AbstractRepository | |||
{ | |||
use MerchantRepositoryQueryTrait; | |||
public function __construct(ManagerRegistry $registry) | |||
{ | |||
parent::__construct($registry, Address::class); |
@@ -3,10 +3,13 @@ | |||
namespace Lc\CaracoleBundle\Repository\Address; | |||
use Knp\Component\Pager\PaginatorInterface; | |||
use Lc\CaracoleBundle\Repository\MerchantRepositoryQueryTrait; | |||
use Lc\SovBundle\Repository\AbstractRepositoryQuery; | |||
class AddressRepositoryQuery extends AbstractRepositoryQuery implements AddressRepositoryQueryInterface | |||
{ | |||
use MerchantRepositoryQueryTrait; | |||
public function __construct(AddressRepository $repository, PaginatorInterface $paginator) | |||
{ | |||
parent::__construct($repository, 'r', $paginator); |
@@ -3,10 +3,13 @@ | |||
namespace Lc\CaracoleBundle\Repository\File; | |||
use Knp\Component\Pager\PaginatorInterface; | |||
use Lc\CaracoleBundle\Repository\MerchantRepositoryQueryTrait; | |||
use Lc\SovBundle\Repository\AbstractRepositoryQuery; | |||
class DocumentRepositoryQuery extends AbstractRepositoryQuery implements DocumentRepositoryQueryInterface | |||
{ | |||
use MerchantRepositoryQueryTrait; | |||
public function __construct(DocumentRepository $repository, PaginatorInterface $paginator) | |||
{ | |||
parent::__construct($repository, 'r', $paginator); |
@@ -4,7 +4,7 @@ namespace Lc\CaracoleBundle\Repository; | |||
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface; | |||
trait RepositoryMerchantTrait | |||
trait MerchantRepositoryQueryTrait | |||
{ | |||
public function filterByMerchant(MerchantInterface $merchant) | |||
{ |
@@ -0,0 +1,11 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Repository\Newsletter; | |||
use Lc\CaracoleBundle\Repository\MerchantRepositoryQueryTrait; | |||
use Lc\SovBundle\Repository\Newsletter\NewsletterRepositoryQuery as SovNewsletterRepositoryQuery; | |||
class NewsletterRepositoryQuery extends SovNewsletterRepositoryQuery | |||
{ | |||
use MerchantRepositoryQueryTrait; | |||
} |
@@ -3,10 +3,15 @@ | |||
namespace Lc\CaracoleBundle\Repository\Order; | |||
use Knp\Component\Pager\PaginatorInterface; | |||
use Lc\CaracoleBundle\Repository\MerchantRepositoryQueryTrait; | |||
use Lc\CaracoleBundle\Repository\SectionRepositoryQueryTrait; | |||
use Lc\SovBundle\Repository\AbstractRepositoryQuery; | |||
class OrderShopRepositoryQuery extends AbstractRepositoryQuery implements OrderShopRepositoryQueryInterface | |||
{ | |||
use MerchantRepositoryQueryTrait; | |||
use SectionRepositoryQueryTrait; | |||
public function __construct(OrderShopRepository $repository, PaginatorInterface $paginator) | |||
{ | |||
parent::__construct($repository, 'r', $paginator); |
@@ -3,12 +3,22 @@ | |||
namespace Lc\CaracoleBundle\Repository\PointSale; | |||
use Knp\Component\Pager\PaginatorInterface; | |||
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface; | |||
use Lc\CaracoleBundle\Repository\MerchantRepositoryQueryTrait; | |||
use Lc\SovBundle\Repository\AbstractRepositoryQuery; | |||
class PointSaleRepositoryQuery extends AbstractRepositoryQuery implements PointSaleRepositoryQueryInterface | |||
{ | |||
public function __construct(PointSaleRepository $repository, PaginatorInterface $paginator) | |||
{ | |||
parent::__construct($repository, 'r', $paginator); | |||
} | |||
public function filterByMerchant(MerchantInterface $merchant) | |||
{ | |||
return $this | |||
->andWhere(':merchant MEMBER OF .merchant') | |||
->setParameter(':merchant', $merchant); | |||
} | |||
} |
@@ -3,10 +3,15 @@ | |||
namespace Lc\CaracoleBundle\Repository\Product; | |||
use Knp\Component\Pager\PaginatorInterface; | |||
use Lc\CaracoleBundle\Repository\MerchantRepositoryQueryTrait; | |||
use Lc\CaracoleBundle\Repository\SectionRepositoryQueryTrait; | |||
use Lc\SovBundle\Repository\AbstractRepositoryQuery; | |||
class ProductCategoryRepositoryQuery extends AbstractRepositoryQuery implements ProductCategoryRepositoryQueryInterface | |||
{ | |||
use MerchantRepositoryQueryTrait; | |||
use SectionRepositoryQueryTrait; | |||
public function __construct(ProductCategoryRepository $repository, PaginatorInterface $paginator) | |||
{ | |||
parent::__construct($repository, 'r', $paginator); |
@@ -3,10 +3,15 @@ | |||
namespace Lc\CaracoleBundle\Repository\Product; | |||
use Knp\Component\Pager\PaginatorInterface; | |||
use Lc\CaracoleBundle\Repository\MerchantRepositoryQueryTrait; | |||
use Lc\CaracoleBundle\Repository\SectionRepositoryQueryTrait; | |||
use Lc\SovBundle\Repository\AbstractRepositoryQuery; | |||
class ProductFamilyRepositoryQuery extends AbstractRepositoryQuery implements ProductFamilyRepositoryQueryInterface | |||
{ | |||
use MerchantRepositoryQueryTrait; | |||
use SectionRepositoryQueryTrait; | |||
public function __construct(ProductFamilyRepository $repository, PaginatorInterface $paginator) | |||
{ | |||
parent::__construct($repository, 'r', $paginator); |
@@ -3,10 +3,13 @@ | |||
namespace Lc\CaracoleBundle\Repository\Reduction; | |||
use Knp\Component\Pager\PaginatorInterface; | |||
use Lc\CaracoleBundle\Repository\MerchantRepositoryQueryTrait; | |||
use Lc\SovBundle\Repository\AbstractRepositoryQuery; | |||
class ReductionCartRepositoryQuery extends AbstractRepositoryQuery implements ReductionCartRepositoryQueryInterface | |||
{ | |||
use MerchantRepositoryQueryTrait; | |||
public function __construct(ReductionCartRepository $repository, PaginatorInterface $paginator) | |||
{ | |||
parent::__construct($repository, 'r', $paginator); |
@@ -3,10 +3,13 @@ | |||
namespace Lc\CaracoleBundle\Repository\Reduction; | |||
use Knp\Component\Pager\PaginatorInterface; | |||
use Lc\CaracoleBundle\Repository\MerchantRepositoryQueryTrait; | |||
use Lc\SovBundle\Repository\AbstractRepositoryQuery; | |||
class ReductionCatalogRepositoryQuery extends AbstractRepositoryQuery implements ReductionCatalogRepositoryQueryInterface | |||
{ | |||
use MerchantRepositoryQueryTrait; | |||
public function __construct(ReductionCatalogRepository $repository, PaginatorInterface $paginator) | |||
{ | |||
parent::__construct($repository, 'r', $paginator); |
@@ -3,10 +3,13 @@ | |||
namespace Lc\CaracoleBundle\Repository\Reduction; | |||
use Knp\Component\Pager\PaginatorInterface; | |||
use Lc\CaracoleBundle\Repository\MerchantRepositoryQueryTrait; | |||
use Lc\SovBundle\Repository\AbstractRepositoryQuery; | |||
class ReductionCreditRepositoryQuery extends AbstractRepositoryQuery implements ReductionCreditRepositoryQueryInterface | |||
{ | |||
use MerchantRepositoryQueryTrait; | |||
public function __construct(ReductionCreditRepository $repository, PaginatorInterface $paginator) | |||
{ | |||
parent::__construct($repository, 'r', $paginator); |
@@ -2,15 +2,10 @@ | |||
namespace Lc\CaracoleBundle\Repository\Reminder; | |||
use Lc\CaracoleBundle\Repository\RepositoryMerchantTrait; | |||
use Lc\CaracoleBundle\Repository\MerchantRepositoryQueryTrait; | |||
use Lc\SovBundle\Repository\Reminder\ReminderRepositoryQuery as SovReminderRepositoryQuery; | |||
/** | |||
* class ReminderRepositoryQuery. | |||
* | |||
* @author Simon Vieille <simon@deblan.fr> | |||
*/ | |||
class ReminderRepositoryQuery extends SovReminderRepositoryQuery | |||
{ | |||
use RepositoryMerchantTrait; | |||
use MerchantRepositoryQueryTrait; | |||
} |
@@ -3,10 +3,13 @@ | |||
namespace Lc\CaracoleBundle\Repository\Section; | |||
use Knp\Component\Pager\PaginatorInterface; | |||
use Lc\CaracoleBundle\Repository\MerchantRepositoryQueryTrait; | |||
use Lc\SovBundle\Repository\AbstractRepositoryQuery; | |||
class SectionRepositoryQuery extends AbstractRepositoryQuery implements SectionRepositoryQueryInterface | |||
{ | |||
use MerchantRepositoryQueryTrait; | |||
public function __construct(SectionRepository $repository, PaginatorInterface $paginator) | |||
{ | |||
parent::__construct($repository, 'r', $paginator); |
@@ -0,0 +1,15 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Repository; | |||
use Lc\CaracoleBundle\Model\Section\SectionInterface; | |||
trait SectionRepositoryQueryTrait | |||
{ | |||
public function filterBySection(SectionInterface $section) | |||
{ | |||
return $this | |||
->andWhere('.section = :section') | |||
->setParameter(':section', $section); | |||
} | |||
} |
@@ -3,10 +3,13 @@ | |||
namespace Lc\CaracoleBundle\Repository\Setting; | |||
use Knp\Component\Pager\PaginatorInterface; | |||
use Lc\CaracoleBundle\Repository\MerchantRepositoryQueryTrait; | |||
use Lc\SovBundle\Repository\AbstractRepositoryQuery; | |||
class MerchantSettingRepositoryQuery extends AbstractRepositoryQuery implements MerchantSettingRepositoryQueryInterface | |||
{ | |||
use MerchantRepositoryQueryTrait; | |||
public function __construct(MerchantSettingRepository $repository, PaginatorInterface $paginator) | |||
{ | |||
parent::__construct($repository, 'r', $paginator); |
@@ -3,10 +3,13 @@ | |||
namespace Lc\CaracoleBundle\Repository\Setting; | |||
use Knp\Component\Pager\PaginatorInterface; | |||
use Lc\CaracoleBundle\Repository\SectionRepositoryQueryTrait; | |||
use Lc\SovBundle\Repository\AbstractRepositoryQuery; | |||
class SectionSettingRepositoryQuery extends AbstractRepositoryQuery implements SectionSettingRepositoryQueryInterface | |||
{ | |||
use SectionRepositoryQueryTrait; | |||
public function __construct(SectionSettingRepository $repository, PaginatorInterface $paginator) | |||
{ | |||
parent::__construct($repository, 'r', $paginator); |
@@ -0,0 +1,12 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Repository\Site; | |||
use Lc\CaracoleBundle\Repository\MerchantRepositoryQueryTrait; | |||
use Lc\SovBundle\Repository\Site\NewsRepositoryQuery as SovNewsRepositoryQuery; | |||
class NewsRepositoryQuery extends SovNewsRepositoryQuery | |||
{ | |||
use MerchantRepositoryQueryTrait; | |||
} |
@@ -0,0 +1,14 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Repository\Site; | |||
use Lc\CaracoleBundle\Repository\MerchantRepositoryQueryTrait; | |||
use Lc\CaracoleBundle\Repository\SectionRepositoryQueryTrait; | |||
use Lc\SovBundle\Repository\Site\PageRepositoryQuery as SovPageRepositoryQuery; | |||
class PageRepositoryQuery extends SovPageRepositoryQuery | |||
{ | |||
use MerchantRepositoryQueryTrait; | |||
use SectionRepositoryQueryTrait; | |||
} |
@@ -0,0 +1,12 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Repository\Ticket; | |||
use Lc\CaracoleBundle\Repository\MerchantRepositoryQueryTrait; | |||
use Lc\SovBundle\Repository\Site\TicketRepositoryQuery as SovTicketRepositoryQuery; | |||
class TicketRepositoryQuery extends SovTicketRepositoryQuery | |||
{ | |||
use MerchantRepositoryQueryTrait; | |||
} |
@@ -3,10 +3,13 @@ | |||
namespace Lc\CaracoleBundle\Repository\User; | |||
use Knp\Component\Pager\PaginatorInterface; | |||
use Lc\CaracoleBundle\Repository\MerchantRepositoryQueryTrait; | |||
use Lc\SovBundle\Repository\AbstractRepositoryQuery; | |||
class GroupUserRepositoryQuery extends AbstractRepositoryQuery implements GroupUserRepositoryQueryInterface | |||
{ | |||
use MerchantRepositoryQueryTrait; | |||
public function __construct(GroupUserRepository $repository, PaginatorInterface $paginator) | |||
{ | |||
parent::__construct($repository, 'r', $paginator); |
@@ -3,10 +3,13 @@ | |||
namespace Lc\CaracoleBundle\Repository\User; | |||
use Knp\Component\Pager\PaginatorInterface; | |||
use Lc\CaracoleBundle\Repository\MerchantRepositoryQueryTrait; | |||
use Lc\SovBundle\Repository\AbstractRepositoryQuery; | |||
class UserMerchantRepositoryQuery extends AbstractRepositoryQuery implements UserMerchantRepositoryQueryInterface | |||
{ | |||
use MerchantRepositoryQueryTrait; | |||
public function __construct(UserMerchantRepository $repository, PaginatorInterface $paginator) | |||
{ | |||
parent::__construct($repository, 'r', $paginator); |