Przeglądaj źródła

Repository : ajout des Trait

packProduct
Guillaume 3 lat temu
rodzic
commit
668005f93a
22 zmienionych plików z 125 dodań i 8 usunięć
  1. +3
    -0
      Repository/Address/AddressRepository.php
  2. +3
    -0
      Repository/Address/AddressRepositoryQuery.php
  3. +3
    -0
      Repository/File/DocumentRepositoryQuery.php
  4. +1
    -1
      Repository/MerchantRepositoryQueryTrait.php
  5. +11
    -0
      Repository/Newsletter/NewsletterRepositoryQuery.php
  6. +5
    -0
      Repository/Order/OrderShopRepositoryQuery.php
  7. +10
    -0
      Repository/PointSale/PointSaleRepositoryQuery.php
  8. +5
    -0
      Repository/Product/ProductCategoryRepositoryQuery.php
  9. +5
    -0
      Repository/Product/ProductFamilyRepositoryQuery.php
  10. +3
    -0
      Repository/Reduction/ReductionCartRepositoryQuery.php
  11. +3
    -0
      Repository/Reduction/ReductionCatalogRepositoryQuery.php
  12. +3
    -0
      Repository/Reduction/ReductionCreditRepositoryQuery.php
  13. +2
    -7
      Repository/Reminder/ReminderRepositoryQuery.php
  14. +3
    -0
      Repository/Section/SectionRepositoryQuery.php
  15. +15
    -0
      Repository/SectionRepositoryQueryTrait.php
  16. +3
    -0
      Repository/Setting/MerchantSettingRepositoryQuery.php
  17. +3
    -0
      Repository/Setting/SectionSettingRepositoryQuery.php
  18. +12
    -0
      Repository/Site/NewsRepositoryQuery.php
  19. +14
    -0
      Repository/Site/PageRepositoryQuery.php
  20. +12
    -0
      Repository/Ticket/TicketRepositoryQuery.php
  21. +3
    -0
      Repository/User/GroupUserRepositoryQuery.php
  22. +3
    -0
      Repository/User/UserMerchantRepositoryQuery.php

+ 3
- 0
Repository/Address/AddressRepository.php Wyświetl plik

@@ -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
- 0
Repository/Address/AddressRepositoryQuery.php Wyświetl plik

@@ -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
- 0
Repository/File/DocumentRepositoryQuery.php Wyświetl plik

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

Repository/RepositoryMerchantTrait.php → Repository/MerchantRepositoryQueryTrait.php Wyświetl plik

@@ -4,7 +4,7 @@ namespace Lc\CaracoleBundle\Repository;

use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;

trait RepositoryMerchantTrait
trait MerchantRepositoryQueryTrait
{
public function filterByMerchant(MerchantInterface $merchant)
{

+ 11
- 0
Repository/Newsletter/NewsletterRepositoryQuery.php Wyświetl plik

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

+ 5
- 0
Repository/Order/OrderShopRepositoryQuery.php Wyświetl plik

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

+ 10
- 0
Repository/PointSale/PointSaleRepositoryQuery.php Wyświetl plik

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

+ 5
- 0
Repository/Product/ProductCategoryRepositoryQuery.php Wyświetl plik

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

+ 5
- 0
Repository/Product/ProductFamilyRepositoryQuery.php Wyświetl plik

@@ -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
- 0
Repository/Reduction/ReductionCartRepositoryQuery.php Wyświetl plik

@@ -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
- 0
Repository/Reduction/ReductionCatalogRepositoryQuery.php Wyświetl plik

@@ -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
- 0
Repository/Reduction/ReductionCreditRepositoryQuery.php Wyświetl plik

@@ -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
- 7
Repository/Reminder/ReminderRepositoryQuery.php Wyświetl plik

@@ -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
- 0
Repository/Section/SectionRepositoryQuery.php Wyświetl plik

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

+ 15
- 0
Repository/SectionRepositoryQueryTrait.php Wyświetl plik

@@ -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
- 0
Repository/Setting/MerchantSettingRepositoryQuery.php Wyświetl plik

@@ -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
- 0
Repository/Setting/SectionSettingRepositoryQuery.php Wyświetl plik

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

+ 12
- 0
Repository/Site/NewsRepositoryQuery.php Wyświetl plik

@@ -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;

}

+ 14
- 0
Repository/Site/PageRepositoryQuery.php Wyświetl plik

@@ -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;

}

+ 12
- 0
Repository/Ticket/TicketRepositoryQuery.php Wyświetl plik

@@ -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
- 0
Repository/User/GroupUserRepositoryQuery.php Wyświetl plik

@@ -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
- 0
Repository/User/UserMerchantRepositoryQuery.php Wyświetl plik

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

Ładowanie…
Anuluj
Zapisz