Преглед изворни кода

Repository : ajout des Trait

packProduct
Guillaume пре 3 година
родитељ
комит
668005f93a
22 измењених фајлова са 125 додато и 8 уклоњено
  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 Прегледај датотеку

@@ -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 Прегледај датотеку

@@ -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 Прегледај датотеку

@@ -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 Прегледај датотеку

@@ -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 Прегледај датотеку

@@ -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 Прегледај датотеку

@@ -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 Прегледај датотеку

@@ -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 Прегледај датотеку

@@ -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 Прегледај датотеку

@@ -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 Прегледај датотеку

@@ -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 Прегледај датотеку

@@ -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 Прегледај датотеку

@@ -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 Прегледај датотеку

@@ -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 Прегледај датотеку

@@ -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 Прегледај датотеку

@@ -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 Прегледај датотеку

@@ -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 Прегледај датотеку

@@ -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 Прегледај датотеку

@@ -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 Прегледај датотеку

@@ -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 Прегледај датотеку

@@ -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 Прегледај датотеку

@@ -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 Прегледај датотеку

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

Loading…
Откажи
Сачувај