@@ -5,6 +5,7 @@ namespace Lc\CaracoleBundle\Controller; | |||
use Doctrine\ORM\QueryBuilder; | |||
use EasyCorp\Bundle\EasyAdminBundle\Collection\FieldCollection; | |||
use EasyCorp\Bundle\EasyAdminBundle\Collection\FilterCollection; | |||
use EasyCorp\Bundle\EasyAdminBundle\Config\KeyValueStore; | |||
use Lc\CaracoleBundle\Doctrine\Extension\FilterMerchantInterface; | |||
use Lc\CaracoleBundle\Doctrine\Extension\FilterMultipleMerchantsInterface; | |||
use Lc\CaracoleBundle\Doctrine\Extension\FilterSectionInterface; | |||
@@ -28,6 +29,19 @@ trait AdminControllerTrait | |||
'user_merchant_factory' => UserMerchantFactory::class, | |||
]); | |||
} | |||
public function configureResponseParameters(KeyValueStore $responseParameters): KeyValueStore | |||
{ | |||
$responseParameters = parent::configureResponseParameters($responseParameters); | |||
// affichage du filtre sur section | |||
if($this->isInstanceOf(FilterSectionInterface::class)) { | |||
$responseParameters->set('display_switch_section', true); | |||
} | |||
return $responseParameters; | |||
} | |||
public function createIndexQueryBuilder( | |||
SearchDto $searchDto, | |||
EntityDto $entityDto, |
@@ -84,7 +84,7 @@ abstract class CreditHistoryAdminController extends AbstractAdminController | |||
public function configureCrud(Crud $crud): Crud | |||
{ | |||
$crud->overrideTemplate('crud/index', '@LcCaracole/admin/credit/credit_history_index.html.twig'); | |||
$crud->overrideTemplate('crud/index', '@LcCaracole/admin/credit/index_credithistory.html.twig'); | |||
return $crud; | |||
} |
@@ -8,9 +8,13 @@ use Lc\CaracoleBundle\Form\Merchant\SwitchMerchantFormType; | |||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; | |||
use Symfony\Component\HttpFoundation\Request; | |||
use Symfony\Component\Security\Core\Security; | |||
use Symfony\Component\Routing\Annotation\Route; | |||
class FavoriteMerchantController extends AbstractController | |||
{ | |||
/** | |||
* @Route("/merchant/favorite", name="carac_merchant_favorite") | |||
*/ | |||
public function favoriteMerchant(Request $request, Security $security, EntityManagerInterface $em) | |||
{ | |||
$user = $security->getUser() ; |
@@ -7,10 +7,13 @@ use Lc\CaracoleBundle\Form\Merchant\SwitchMerchantFormType; | |||
use Lc\CaracoleBundle\Repository\Merchant\MerchantRepository; | |||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; | |||
use Symfony\Component\HttpFoundation\Request; | |||
use Symfony\Component\Routing\Annotation\Route; | |||
class SwitchMerchantController extends AbstractController | |||
{ | |||
/** | |||
* @Route("/merchant/switch", name="carac_merchant_switch") | |||
*/ | |||
public function switchMerchant(Request $request, MerchantRepository $merchantRepository) | |||
{ | |||
$form = $this->createForm(SwitchMerchantFormType::class); |
@@ -8,10 +8,14 @@ use Lc\CaracoleBundle\Repository\Section\SectionRepository; | |||
use Lc\CaracoleBundle\Resolver\MerchantResolver; | |||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; | |||
use Symfony\Component\HttpFoundation\Request; | |||
use Symfony\Component\Routing\Annotation\Route; | |||
class SwitchSectionAdminController extends AbstractController | |||
{ | |||
/** | |||
* @Route("/section/switch", name="carac_section_switch") | |||
*/ | |||
public function switchSection( | |||
Request $request, | |||
EntityManagerInterface $em, |
@@ -15,6 +15,7 @@ use Lc\SovBundle\Form\Setting\SiteSettingsFormType; | |||
use Lc\SovBundle\Repository\Site\SiteRepository; | |||
use Lc\SovBundle\Translation\TranslatorAdmin; | |||
use Symfony\Component\HttpFoundation\Request; | |||
use Symfony\Component\Routing\Annotation\Route; | |||
class SettingAdminController extends SovSettingController | |||
{ | |||
@@ -47,11 +48,17 @@ class SettingAdminController extends SovSettingController | |||
$this->siteRepository = $siteRepository; | |||
} | |||
/** | |||
* @Route("/admin/setting/merchant", name="carac_admin_setting_merchant") | |||
*/ | |||
public function manageMerchant(Request $request) | |||
{ | |||
return $this->manage($request, 'merchant'); | |||
} | |||
/** | |||
* @Route("/admin/setting/section", name="carac_admin_setting_section") | |||
*/ | |||
public function manageSection(Request $request) | |||
{ | |||
return $this->manage($request, 'section'); | |||
@@ -86,25 +93,28 @@ class SettingAdminController extends SovSettingController | |||
} | |||
return $this->render( | |||
'@LcCaracole/admin/setting/' . $type . '.html.twig', | |||
[ | |||
'resolver' => $resolver, | |||
'setting_definition' => $settingDefinition, | |||
'form' => $form->createView() | |||
] | |||
'@LcCaracole/admin/setting/edit_' . $type . '.html.twig', | |||
[ | |||
'display_switch_section' => ($type == 'section') ? true : false, | |||
'resolver' => $resolver, | |||
'setting_definition' => $settingDefinition, | |||
'form' => $form->createView() | |||
] | |||
); | |||
} | |||
} | |||
/** | |||
* @Route("/admin/setting/site2", name="carac_admin_setting_site") | |||
*/ | |||
public function manageGlobal(Request $request) | |||
{ | |||
$site = $this->siteRepository->findOneByDevAlias('default') ; | |||
$site = $this->siteRepository->findOneByDevAlias('default'); | |||
$form = $this->createForm(SiteSettingsFormType::class, $site); | |||
$form->handleRequest($request); | |||
if ($form->isSubmitted() && $form->isValid()) { | |||
$this->em->update($site); | |||
$this->em->flush(); | |||
@@ -112,7 +122,7 @@ class SettingAdminController extends SovSettingController | |||
} | |||
return $this->render( | |||
'@LcCaracole/admin/setting/global.html.twig' , | |||
'@LcCaracole/admin/setting/edit_site.html.twig', | |||
[ | |||
'setting_definition' => $this->siteSettingDefinition, | |||
'form' => $form->createView() |
@@ -2,6 +2,7 @@ | |||
namespace Lc\CaracoleBundle\Controller\Ticket; | |||
use EasyCorp\Bundle\EasyAdminBundle\Config\KeyValueStore; | |||
use Lc\CaracoleBundle\Controller\AdminControllerTrait; | |||
use Lc\SovBundle\Controller\Ticket\TicketAdminController as SovTicketAdminController; | |||
@@ -167,7 +167,7 @@ abstract class UserMerchantAdminController extends AbstractAdminController | |||
} | |||
return $this->render( | |||
'@LcCaracole/admin/user/usermerchant_new.html.twig', | |||
'@LcCaracole/admin/user/new_usermerchant.html.twig', | |||
[ | |||
'form' => $form->createView(), | |||
] |
@@ -6,15 +6,12 @@ use Doctrine\ORM\EntityManagerInterface; | |||
use Lc\CaracoleBundle\Definition\MerchantSettingDefinitionInterface; | |||
use Lc\CaracoleBundle\Factory\Setting\MerchantSettingFactory; | |||
use Lc\CaracoleBundle\Factory\Setting\SectionSettingFactory; | |||
use Lc\CaracoleBundle\Factory\User\UserMerchantFactory; | |||
use Lc\CaracoleBundle\Model\Section\SectionInterface; | |||
use Lc\CaracoleBundle\Repository\Merchant\MerchantRepository; | |||
use Lc\CaracoleBundle\Definition\SectionSettingDefinitionInterface; | |||
use Lc\CaracoleBundle\Repository\Merchant\MerchantRepository; | |||
use Lc\CaracoleBundle\Repository\Section\SectionRepository; | |||
use Lc\CaracoleBundle\Resolver\MerchantResolver; | |||
use Symfony\Component\EventDispatcher\EventSubscriberInterface; | |||
use Symfony\Component\HttpKernel\KernelEvents; | |||
use Symfony\Component\Security\Core\Security; | |||
class SettingEventSubscriber implements EventSubscriberInterface | |||
{ |
@@ -50,7 +50,7 @@ class UserRolesEventSubscriber implements EventSubscriberInterface | |||
return; | |||
} | |||
if ($this->setUserRoles($event->getRequest())) { | |||
$response = new RedirectResponse($this->router->generate('admin_dashboard')); | |||
$response = new RedirectResponse($this->router->generate('app_admin_dashboard')); | |||
$event->setResponse($response); | |||
} | |||
} |
@@ -0,0 +1,23 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\Address; | |||
use App\Entity\Address\Address; | |||
use Lc\CaracoleBundle\Factory\MerchantFactoryTrait; | |||
use Lc\CaracoleBundle\Model\Address\AddressInterface; | |||
use Lc\SovBundle\Factory\AbstractFactory; | |||
class AddressFactory extends AbstractFactory implements AddressFactoryInterface | |||
{ | |||
use MerchantFactoryTrait; | |||
public function create(): AddressInterface | |||
{ | |||
$address = new Address(); | |||
$address->setMerchant($this->merchant); | |||
return $address; | |||
} | |||
} |
@@ -0,0 +1,8 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\Address; | |||
interface AddressFactoryInterface | |||
{ | |||
} |
@@ -0,0 +1,18 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\Config; | |||
use App\Entity\Config\TaxRate; | |||
use Lc\CaracoleBundle\Model\Config\TaxRateInterface; | |||
use Lc\SovBundle\Factory\AbstractFactory; | |||
class TaxRateFactory extends AbstractFactory implements TaxRateFactoryInterface | |||
{ | |||
public function create(): TaxRateInterface | |||
{ | |||
$taxRate = new TaxRate(); | |||
return $taxRate; | |||
} | |||
} |
@@ -0,0 +1,8 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\Config; | |||
interface TaxRateFactoryInterface | |||
{ | |||
} |
@@ -0,0 +1,18 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\Config; | |||
use App\Entity\Config\Unit; | |||
use Lc\CaracoleBundle\Model\Config\UnitInterface; | |||
use Lc\SovBundle\Factory\AbstractFactory; | |||
class UnitFactory extends AbstractFactory implements UnitFactoryInterface | |||
{ | |||
public function create(): UnitInterface | |||
{ | |||
$unit = new Unit(); | |||
return $unit; | |||
} | |||
} |
@@ -0,0 +1,8 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\Config; | |||
interface UnitFactoryInterface | |||
{ | |||
} |
@@ -0,0 +1,19 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\Credit; | |||
use App\Entity\Credit\CreditHistory; | |||
use Lc\CaracoleBundle\Factory\CreditHistory\CreditHistoryFactoryInterface; | |||
use Lc\CaracoleBundle\Model\Credit\CreditHistoryInterface; | |||
use Lc\SovBundle\Factory\AbstractFactory; | |||
class CreditHistoryFactory extends AbstractFactory implements CreditHistoryFactoryInterface | |||
{ | |||
public function create(): CreditHistoryInterface | |||
{ | |||
$creditHistory = new CreditHistory(); | |||
return $creditHistory; | |||
} | |||
} |
@@ -0,0 +1,8 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\Credit; | |||
interface CreditHistoryFactoryInterface | |||
{ | |||
} |
@@ -0,0 +1,23 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\File; | |||
use App\Entity\File\Document; | |||
use Lc\CaracoleBundle\Factory\MerchantFactoryTrait; | |||
use Lc\CaracoleBundle\Model\File\DocumentInterface; | |||
use Lc\SovBundle\Factory\AbstractFactory; | |||
class DocumentFactory extends AbstractFactory implements DocumentFactoryInterface | |||
{ | |||
use MerchantFactoryTrait; | |||
public function create(): DocumentInterface | |||
{ | |||
$document = new Document(); | |||
$document->setMerchant($this->merchant); | |||
return $document; | |||
} | |||
} |
@@ -0,0 +1,8 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\File; | |||
interface DocumentFactoryInterface | |||
{ | |||
} |
@@ -0,0 +1,18 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\Merchant; | |||
use App\Entity\Merchant\Merchant; | |||
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface; | |||
use Lc\SovBundle\Factory\AbstractFactory; | |||
class MerchantFactory extends AbstractFactory implements MerchantFactoryInterface | |||
{ | |||
public function create(): MerchantInterface | |||
{ | |||
$merchant = new Merchant(); | |||
return $merchant; | |||
} | |||
} |
@@ -0,0 +1,8 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\Merchant; | |||
interface MerchantFactoryInterface | |||
{ | |||
} |
@@ -0,0 +1,23 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\Newsletter; | |||
use App\Entity\Newsletter\Newsletter; | |||
use Lc\CaracoleBundle\Factory\MerchantFactoryTrait; | |||
use Lc\SovBundle\Model\Newsletter\NewsletterInterface; | |||
use Lc\SovBundle\Factory\Newsletter\NewsletterFactory as SovNewsletterFactory; | |||
class NewsletterFactory extends SovNewsletterFactory | |||
{ | |||
use MerchantFactoryTrait; | |||
public function create(): NewsletterInterface | |||
{ | |||
$newsletter = parent::create(); | |||
$newsletter->setMerchant($this->merchant); | |||
return $newsletter; | |||
} | |||
} |
@@ -0,0 +1,18 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\Order; | |||
use App\Entity\Order\OrderPayment; | |||
use Lc\CaracoleBundle\Model\Order\OrderPaymentInterface; | |||
use Lc\SovBundle\Factory\AbstractFactory; | |||
class OrderPaymentFactory extends AbstractFactory implements OrderPaymentFactoryInterface | |||
{ | |||
public function create(): OrderPaymentInterface | |||
{ | |||
$orderPayment = new OrderPayment(); | |||
return $orderPayment; | |||
} | |||
} |
@@ -0,0 +1,8 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\Order; | |||
interface OrderPaymentFactoryInterface | |||
{ | |||
} |
@@ -0,0 +1,18 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\Order; | |||
use App\Entity\Order\OrderProduct; | |||
use Lc\CaracoleBundle\Model\Order\OrderProductInterface; | |||
use Lc\SovBundle\Factory\AbstractFactory; | |||
class OrderProductFactory extends AbstractFactory implements OrderProductFactoryInterface | |||
{ | |||
public function create(): OrderProductInterface | |||
{ | |||
$orderProduct = new OrderProduct(); | |||
return $orderProduct; | |||
} | |||
} |
@@ -0,0 +1,8 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\Order; | |||
interface OrderProductFactoryInterface | |||
{ | |||
} |
@@ -0,0 +1,18 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\Order; | |||
use App\Entity\Order\OrderProductReductionCatalog; | |||
use Lc\CaracoleBundle\Model\Order\OrderProductReductionCatalogInterface; | |||
use Lc\SovBundle\Factory\AbstractFactory; | |||
class OrderProductReductionCatalogFactory extends AbstractFactory implements OrderProductReductionCatalogFactoryInterface | |||
{ | |||
public function create(): OrderProductReductionCatalogInterface | |||
{ | |||
$orderProductReductionCatalog = new OrderProductReductionCatalog(); | |||
return $orderProductReductionCatalog; | |||
} | |||
} |
@@ -0,0 +1,8 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\Order; | |||
interface OrderProductReductionCatalogFactoryInterface | |||
{ | |||
} |
@@ -0,0 +1,18 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\Order; | |||
use App\Entity\Order\OrderProductRefund; | |||
use Lc\CaracoleBundle\Model\Order\OrderProductRefundInterface; | |||
use Lc\SovBundle\Factory\AbstractFactory; | |||
class OrderProductRefundFactory extends AbstractFactory implements OrderProductRefundFactoryInterface | |||
{ | |||
public function create(): OrderProductRefundInterface | |||
{ | |||
$orderProductRefund = new OrderProductRefund(); | |||
return $orderProductRefund; | |||
} | |||
} |
@@ -0,0 +1,8 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\Order; | |||
interface OrderProductRefundFactoryInterface | |||
{ | |||
} |
@@ -0,0 +1,18 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\Order; | |||
use App\Entity\Order\OrderReductionCart; | |||
use Lc\CaracoleBundle\Model\Order\OrderReductionCartInterface; | |||
use Lc\SovBundle\Factory\AbstractFactory; | |||
class OrderReductionCartFactory extends AbstractFactory implements OrderReductionCartFactoryInterface | |||
{ | |||
public function create(): OrderReductionCartInterface | |||
{ | |||
$orderReductionCart = new OrderReductionCart(); | |||
return $orderReductionCart; | |||
} | |||
} |
@@ -0,0 +1,7 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\Order; | |||
interface OrderReductionCartFactoryInterface{ | |||
} |
@@ -0,0 +1,18 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\Order; | |||
use App\Entity\Order\OrderReductionCredit; | |||
use Lc\CaracoleBundle\Model\Order\OrderReductionCreditInterface; | |||
use Lc\SovBundle\Factory\AbstractFactory; | |||
class OrderReductionCreditFactory extends AbstractFactory implements OrderReductionCreditFactoryInterface | |||
{ | |||
public function create(): OrderReductionCreditInterface | |||
{ | |||
$orderReductionCredit = new OrderReductionCredit(); | |||
return $orderReductionCredit; | |||
} | |||
} |
@@ -0,0 +1,8 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\Order; | |||
interface OrderReductionCreditFactoryInterface | |||
{ | |||
} |
@@ -0,0 +1,18 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\Order; | |||
use App\Entity\Order\OrderRefund; | |||
use Lc\CaracoleBundle\Model\Order\OrderRefundInterface; | |||
use Lc\SovBundle\Factory\AbstractFactory; | |||
class OrderRefundFactory extends AbstractFactory implements OrderRefundFactoryInterface | |||
{ | |||
public function create(): OrderRefundInterface | |||
{ | |||
$orderRefund = new OrderRefund(); | |||
return $orderRefund; | |||
} | |||
} |
@@ -0,0 +1,8 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\Order; | |||
interface OrderRefundFactoryInterface | |||
{ | |||
} |
@@ -0,0 +1,26 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\Order; | |||
use App\Entity\Order\OrderShop; | |||
use Lc\CaracoleBundle\Factory\MerchantFactoryTrait; | |||
use Lc\CaracoleBundle\Factory\SectionFactoryTrait; | |||
use Lc\CaracoleBundle\Model\Order\OrderShopInterface; | |||
use Lc\SovBundle\Factory\AbstractFactory; | |||
class OrderShopFactory extends AbstractFactory implements OrderShopFactoryInterface | |||
{ | |||
use MerchantFactoryTrait; | |||
use SectionFactoryTrait; | |||
public function create(): OrderShopInterface | |||
{ | |||
$orderShop = new OrderShop(); | |||
$orderShop->setMerchant($this->merchant); | |||
$orderShop->setSection($this->section); | |||
return $orderShop; | |||
} | |||
} |
@@ -0,0 +1,8 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\Order; | |||
interface OrderShopFactoryInterface | |||
{ | |||
} |
@@ -0,0 +1,18 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\Order; | |||
use App\Entity\Order\OrderStatus; | |||
use Lc\CaracoleBundle\Model\Order\OrderStatusInterface; | |||
use Lc\SovBundle\Factory\AbstractFactory; | |||
class OrderStatusFactory extends AbstractFactory implements OrderStatusFactoryInterface | |||
{ | |||
public function create(): OrderStatusInterface | |||
{ | |||
$orderStatus = new OrderStatus(); | |||
return $orderStatus; | |||
} | |||
} |
@@ -0,0 +1,8 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\Order; | |||
interface OrderStatusFactoryInterface | |||
{ | |||
} |
@@ -0,0 +1,18 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\Order; | |||
use App\Entity\Order\OrderStatusHistory; | |||
use Lc\CaracoleBundle\Model\Order\OrderStatusHistoryInterface; | |||
use Lc\SovBundle\Factory\AbstractFactory; | |||
class OrderStatusHistoryFactory extends AbstractFactory implements OrderStatusHistoryFactoryInterface | |||
{ | |||
public function create(): OrderStatusHistoryInterface | |||
{ | |||
$orderStatusHistory = new OrderStatusHistory(); | |||
return $orderStatusHistory; | |||
} | |||
} |
@@ -0,0 +1,8 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\Order; | |||
interface OrderStatusHistoryFactoryInterface | |||
{ | |||
} |
@@ -0,0 +1,23 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\PointSale; | |||
use App\Entity\PointSale\PointSale; | |||
use Lc\CaracoleBundle\Factory\MerchantFactoryTrait; | |||
use Lc\CaracoleBundle\Model\PointSale\PointSaleInterface; | |||
use Lc\SovBundle\Factory\AbstractFactory; | |||
class PointSaleFactory extends AbstractFactory implements PointSaleFactoryInterface | |||
{ | |||
use MerchantFactoryTrait; | |||
public function create(): PointSaleInterface | |||
{ | |||
$pointSale = new PointSale(); | |||
$pointSale->addMerchant($this->merchant); | |||
return $pointSale; | |||
} | |||
} |
@@ -0,0 +1,8 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\PointSale; | |||
interface PointSaleFactoryInterface | |||
{ | |||
} |
@@ -0,0 +1,26 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\Product; | |||
use App\Entity\Product\ProductCategory; | |||
use Lc\CaracoleBundle\Factory\MerchantFactoryTrait; | |||
use Lc\CaracoleBundle\Factory\SectionFactoryTrait; | |||
use Lc\CaracoleBundle\Model\Product\ProductCategoryInterface; | |||
use Lc\SovBundle\Factory\AbstractFactory; | |||
class ProductCategoryFactory extends AbstractFactory implements ProductCategoryFactoryInterface | |||
{ | |||
use MerchantFactoryTrait; | |||
use SectionFactoryTrait; | |||
public function create(): ProductCategoryInterface | |||
{ | |||
$productCategory = new ProductCategory(); | |||
$productCategory->setMerchant($this->merchant); | |||
$productCategory->setSection($this->section); | |||
return $productCategory; | |||
} | |||
} |
@@ -0,0 +1,8 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\Product; | |||
interface ProductCategoryFactoryInterface | |||
{ | |||
} |
@@ -0,0 +1,18 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\Product; | |||
use App\Entity\Product\Product; | |||
use Lc\CaracoleBundle\Model\Product\ProductInterface; | |||
use Lc\SovBundle\Factory\AbstractFactory; | |||
class ProductFactory extends AbstractFactory implements ProductFactoryInterface | |||
{ | |||
public function create(): ProductInterface | |||
{ | |||
$product = new Product(); | |||
return $product; | |||
} | |||
} |
@@ -0,0 +1,8 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\Product; | |||
interface ProductFactoryInterface | |||
{ | |||
} |
@@ -0,0 +1,26 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\Product; | |||
use App\Entity\Product\ProductFamily; | |||
use Lc\CaracoleBundle\Factory\MerchantFactoryTrait; | |||
use Lc\CaracoleBundle\Factory\SectionFactoryTrait; | |||
use Lc\CaracoleBundle\Model\Product\ProductFamilyInterface; | |||
use Lc\SovBundle\Factory\AbstractFactory; | |||
class ProductFamilyFactory extends AbstractFactory implements ProductFamilyFactoryInterface | |||
{ | |||
use MerchantFactoryTrait; | |||
use SectionFactoryTrait; | |||
public function create(): ProductFamilyInterface | |||
{ | |||
$productFamily = new ProductFamily(); | |||
$productFamily->setMerchant($this->merchant); | |||
$productFamily->setSection($this->section); | |||
return $productFamily; | |||
} | |||
} |
@@ -0,0 +1,8 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\Product; | |||
interface ProductFamilyFactoryInterface | |||
{ | |||
} |
@@ -0,0 +1,23 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\Reduction; | |||
use App\Entity\Reduction\ReductionCart; | |||
use Lc\CaracoleBundle\Factory\MerchantFactoryTrait; | |||
use Lc\CaracoleBundle\Model\Reduction\ReductionCartInterface; | |||
use Lc\SovBundle\Factory\AbstractFactory; | |||
class ReductionCartFactory extends AbstractFactory implements ReductionCartFactoryInterface | |||
{ | |||
use MerchantFactoryTrait; | |||
public function create(): ReductionCartInterface | |||
{ | |||
$reductionCart = new ReductionCart(); | |||
$reductionCart->setMerchant($this->merchant); | |||
return $reductionCart; | |||
} | |||
} |
@@ -0,0 +1,8 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\Reduction; | |||
interface ReductionCartFactoryInterface | |||
{ | |||
} |
@@ -0,0 +1,23 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\Reduction; | |||
use App\Entity\Reduction\ReductionCatalog; | |||
use Lc\CaracoleBundle\Factory\MerchantFactoryTrait; | |||
use Lc\CaracoleBundle\Model\Reduction\ReductionCatalogInterface; | |||
use Lc\SovBundle\Factory\AbstractFactory; | |||
class ReductionCatalogFactory extends AbstractFactory implements ReductionCatalogFactoryInterface | |||
{ | |||
use MerchantFactoryTrait; | |||
public function create(): ReductionCatalogInterface | |||
{ | |||
$reductionCatalog = new ReductionCatalog(); | |||
$reductionCatalog->setMerchant($this->merchant); | |||
return $reductionCatalog; | |||
} | |||
} |
@@ -0,0 +1,8 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\Reduction; | |||
interface ReductionCatalogFactoryInterface | |||
{ | |||
} |
@@ -0,0 +1,23 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\Reduction; | |||
use App\Entity\Reduction\ReductionCredit; | |||
use Lc\CaracoleBundle\Factory\MerchantFactoryTrait; | |||
use Lc\CaracoleBundle\Model\Reduction\ReductionCreditInterface; | |||
use Lc\SovBundle\Factory\AbstractFactory; | |||
class ReductionCreditFactory extends AbstractFactory implements ReductionCreditFactoryInterface | |||
{ | |||
use MerchantFactoryTrait; | |||
public function create(): ReductionCreditInterface | |||
{ | |||
$reductionCredit = new ReductionCredit(); | |||
$reductionCredit->setMerchant($this->merchant); | |||
return $reductionCredit; | |||
} | |||
} |
@@ -0,0 +1,8 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\Reduction; | |||
interface ReductionCreditFactoryInterface | |||
{ | |||
} |
@@ -0,0 +1,24 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\Section; | |||
use App\Entity\Section\Section; | |||
use Lc\CaracoleBundle\Factory\MerchantFactoryTrait; | |||
use Lc\CaracoleBundle\Factory\SectionFactoryTrait; | |||
use Lc\CaracoleBundle\Model\Section\SectionInterface; | |||
use Lc\SovBundle\Factory\AbstractFactory; | |||
class SectionFactory extends AbstractFactory implements SectionFactoryInterface | |||
{ | |||
use MerchantFactoryTrait; | |||
public function create(): SectionInterface | |||
{ | |||
$section = new Section(); | |||
$section->setMerchant($this->merchant); | |||
return $section; | |||
} | |||
} |
@@ -0,0 +1,8 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\Section; | |||
interface SectionFactoryInterface | |||
{ | |||
} |
@@ -4,17 +4,18 @@ namespace Lc\CaracoleBundle\Factory\Setting; | |||
use App\Entity\Setting\SectionSetting; | |||
use Lc\CaracoleBundle\Factory\MerchantFactoryTrait; | |||
use Lc\CaracoleBundle\Factory\SectionFactoryTrait; | |||
use Lc\SovBundle\Factory\AbstractFactory; | |||
class SectionSettingFactory extends AbstractFactory | |||
{ | |||
use MerchantFactoryTrait; | |||
use SectionFactoryTrait; | |||
public function create() | |||
{ | |||
$sectionSetting = new SectionSetting(); | |||
$sectionSetting->setMerchant($this->merchant); | |||
$sectionSetting->setSection($this->section); | |||
return $sectionSetting; | |||
} |
@@ -0,0 +1,21 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\Site; | |||
use Lc\CaracoleBundle\Factory\MerchantFactoryTrait; | |||
use Lc\SovBundle\Factory\Site\NewsFactory as SovNewsFactory; | |||
use Lc\SovBundle\Model\Site\NewsInterface; | |||
class NewsFactory extends SovNewsFactory | |||
{ | |||
use MerchantFactoryTrait; | |||
public function create(): NewsInterface | |||
{ | |||
$news = parent::create(); | |||
$news->setMerchant($this->merchant); | |||
return $news; | |||
} | |||
} |
@@ -0,0 +1,24 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\Site; | |||
use Lc\CaracoleBundle\Factory\MerchantFactoryTrait; | |||
use Lc\CaracoleBundle\Factory\SectionFactoryTrait; | |||
use Lc\SovBundle\Factory\Site\PageFactory as SovPageFactory; | |||
use Lc\SovBundle\Model\Site\PageInterface; | |||
class PageFactory extends SovPageFactory | |||
{ | |||
use MerchantFactoryTrait; | |||
use SectionFactoryTrait; | |||
public function create(): PageInterface | |||
{ | |||
$page = parent::create(); | |||
$page->setMerchant($this->merchant); | |||
$page->setSection($this->section); | |||
return $page; | |||
} | |||
} |
@@ -5,12 +5,13 @@ namespace Lc\CaracoleBundle\Factory\Ticket; | |||
use Lc\CaracoleBundle\Factory\MerchantFactoryTrait; | |||
use Lc\CaracoleBundle\Factory\SectionFactoryTrait; | |||
use Lc\SovBundle\Factory\Ticket\TicketFactory as SovTicketFactory; | |||
use Lc\SovBundle\Model\Ticket\TicketInterface; | |||
class TicketFactory extends SovTicketFactory | |||
{ | |||
use MerchantFactoryTrait; | |||
public function create() | |||
public function create(): TicketInterface | |||
{ | |||
$ticket = parent::create(); | |||
@@ -0,0 +1,23 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\User; | |||
use App\Entity\User\GroupUser; | |||
use Lc\CaracoleBundle\Factory\MerchantFactoryTrait; | |||
use Lc\SovBundle\Factory\AbstractFactory; | |||
use Lc\SovBundle\Model\User\GroupUserInterface; | |||
class GroupUserFactory extends AbstractFactory implements GroupUserFactoryInterface | |||
{ | |||
use MerchantFactoryTrait; | |||
public function create(): GroupUserInterface | |||
{ | |||
$groupUser = new GroupUser(); | |||
$groupUser->setMerchant($this->merchant); | |||
return $groupUser; | |||
} | |||
} |
@@ -0,0 +1,8 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\User; | |||
interface GroupUserFactoryInterface | |||
{ | |||
} |
@@ -0,0 +1,16 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\User; | |||
use Lc\SovBundle\Factory\User\UserFactory as SovUserFactory; | |||
use Lc\SovBundle\Model\User\UserInterface; | |||
class UserFactory extends SovUserFactory | |||
{ | |||
public function create(): UserInterface | |||
{ | |||
$user = parent::create(); | |||
return $user; | |||
} | |||
} |
@@ -0,0 +1,18 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\User; | |||
use App\Entity\User\Visitor; | |||
use Lc\CaracoleBundle\Model\User\VisitorInterface; | |||
use Lc\SovBundle\Factory\AbstractFactory; | |||
class VisitorFactory extends AbstractFactory implements VisitorFactoryInterface | |||
{ | |||
public function create(): VisitorInterface | |||
{ | |||
$visitor = new Visitor(); | |||
return $visitor; | |||
} | |||
} |
@@ -0,0 +1,8 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Factory\User; | |||
interface VisitorFactoryInterface | |||
{ | |||
} |
@@ -1,8 +0,0 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Model\Credit; | |||
interface CreditConfigInterface | |||
{ | |||
} |
@@ -1,101 +0,0 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Model\Credit; | |||
use Doctrine\ORM\Mapping as ORM; | |||
/** | |||
* @ORM\MappedSuperclass() | |||
*/ | |||
abstract class CreditConfigModel | |||
{ | |||
/** | |||
* @ORM\Column(type="boolean") | |||
*/ | |||
protected $active; | |||
/** | |||
* @ORM\Column(type="float", nullable=true) | |||
*/ | |||
protected $limitAmount; | |||
/** | |||
* @ORM\Column(type="float", nullable=true) | |||
*/ | |||
protected $limitReminder; | |||
/** | |||
* @ORM\Column(type="string", length=31, nullable=true) | |||
*/ | |||
protected $behavior; | |||
/** | |||
* @ORM\Column(type="boolean", nullable=true) | |||
*/ | |||
protected $processOrderCheckedDefault; | |||
public function __toString() | |||
{ | |||
return ''; | |||
} | |||
public function getActive(): ?bool | |||
{ | |||
return $this->active; | |||
} | |||
public function setActive(bool $active): self | |||
{ | |||
$this->active = $active; | |||
return $this; | |||
} | |||
public function getLimitAmount(): ?float | |||
{ | |||
return $this->limitAmount; | |||
} | |||
public function setLimitAmount(?float $limitAmount): self | |||
{ | |||
$this->limitAmount = $limitAmount; | |||
return $this; | |||
} | |||
public function getLimitReminder(): ?float | |||
{ | |||
return $this->limitReminder; | |||
} | |||
public function setLimitReminder(?float $limitReminder): self | |||
{ | |||
$this->limitReminder = $limitReminder; | |||
return $this; | |||
} | |||
public function getBehavior(): ?string | |||
{ | |||
return $this->behavior; | |||
} | |||
public function setBehavior(?string $behavior): self | |||
{ | |||
$this->behavior = $behavior; | |||
return $this; | |||
} | |||
public function getProcessOrderCheckedDefault(): ?bool | |||
{ | |||
return $this->processOrderCheckedDefault; | |||
} | |||
public function setProcessOrderCheckedDefault(?bool $processOrderCheckedDefault): self | |||
{ | |||
$this->processOrderCheckedDefault = $processOrderCheckedDefault; | |||
return $this; | |||
} | |||
} |
@@ -7,7 +7,6 @@ use Doctrine\Common\Collections\Collection; | |||
use Doctrine\ORM\Mapping as ORM; | |||
use Lc\CaracoleBundle\Model\Address\AddressInterface; | |||
use Lc\CaracoleBundle\Model\Config\TaxRateInterface; | |||
use Lc\CaracoleBundle\Model\Credit\CreditConfigInterface; | |||
use Lc\SovBundle\Model\Newsletter\NewsletterInterface; | |||
use Lc\CaracoleBundle\Model\PointSale\PointSaleInterface; | |||
use Lc\CaracoleBundle\Model\Product\ProductCategoryInterface; | |||
@@ -27,12 +26,6 @@ abstract class MerchantModel extends AbstractFullEntity | |||
use EntitySettingTrait; | |||
/** | |||
* @ORM\OneToOne(targetEntity="Lc\CaracoleBundle\Model\Credit\CreditConfigInterface", cascade={"persist", "remove"}) | |||
* @ORM\JoinColumn(nullable=true) | |||
*/ | |||
protected $creditConfig; | |||
/** | |||
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Config\TaxRateInterface") | |||
* @ORM\JoinColumn(nullable=false) | |||
@@ -101,18 +94,6 @@ abstract class MerchantModel extends AbstractFullEntity | |||
return $this->getTitle() ; | |||
} | |||
public function getCreditConfig(): ?CreditConfigInterface | |||
{ | |||
return $this->creditConfig; | |||
} | |||
public function setCreditConfig(CreditConfigInterface $creditConfig): self | |||
{ | |||
$this->creditConfig = $creditConfig; | |||
return $this; | |||
} | |||
public function getTaxRate(): ?TaxRateInterface | |||
{ | |||
return $this->taxRate; |
@@ -1,8 +0,0 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Model\PointSale; | |||
interface PointSaleDayInfoInterface | |||
{ | |||
} |
@@ -1,81 +0,0 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Model\PointSale; | |||
use Doctrine\ORM\Mapping as ORM; | |||
use Lc\SovBundle\Doctrine\Pattern\AbstractLightEntity; | |||
/** | |||
* @ORM\MappedSuperclass() | |||
*/ | |||
abstract class PointSaleDayInfoModel extends AbstractLightEntity | |||
{ | |||
/** | |||
* @ORM\Column(type="boolean") | |||
*/ | |||
protected $active; | |||
/** | |||
* @ORM\Column(type="smallint") | |||
*/ | |||
protected $day; | |||
/** | |||
* @ORM\Column(type="text", nullable=true) | |||
*/ | |||
protected $description; | |||
/** | |||
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\PointSale\PointSaleInterface", inversedBy="pointSaleDayInfos") | |||
* @ORM\JoinColumn(nullable=false) | |||
*/ | |||
protected $pointSale; | |||
public function getActive(): ?bool | |||
{ | |||
return $this->active; | |||
} | |||
public function setActive(bool $active): self | |||
{ | |||
$this->active = $active; | |||
return $this; | |||
} | |||
public function getDay(): ?int | |||
{ | |||
return $this->day; | |||
} | |||
public function setDay(int $day): self | |||
{ | |||
$this->day = $day; | |||
return $this; | |||
} | |||
public function getDescription(): ?string | |||
{ | |||
return $this->description; | |||
} | |||
public function setDescription(?string $description): self | |||
{ | |||
$this->description = $description; | |||
return $this; | |||
} | |||
public function getPointSale(): ?PointSaleInterface | |||
{ | |||
return $this->pointSale; | |||
} | |||
public function setPointSale(?PointSaleInterface $pointSale): self | |||
{ | |||
$this->pointSale = $pointSale; | |||
return $this; | |||
} | |||
} |
@@ -32,11 +32,6 @@ abstract class PointSaleModel extends AbstractFullEntity implements FilterMultip | |||
*/ | |||
protected $code; | |||
/** | |||
* @ORM\OneToMany(targetEntity="Lc\CaracoleBundle\Model\PointSale\PointSaleDayInfoInterface", mappedBy="pointSale", orphanRemoval=true) | |||
*/ | |||
protected $pointSaleDayInfos; | |||
/** | |||
* @ORM\OneToOne(targetEntity="Lc\CaracoleBundle\Model\Address\AddressInterface", inversedBy="pointSale", cascade={"persist", "remove"}) | |||
* @ORM\JoinColumn(nullable=false) | |||
@@ -52,7 +47,6 @@ abstract class PointSaleModel extends AbstractFullEntity implements FilterMultip | |||
public function __construct() | |||
{ | |||
$this->merchants = new ArrayCollection(); | |||
$this->pointSaleDayInfos = new ArrayCollection(); | |||
$this->userPointSales = new ArrayCollection(); | |||
} | |||
@@ -104,37 +98,6 @@ abstract class PointSaleModel extends AbstractFullEntity implements FilterMultip | |||
return $this; | |||
} | |||
/** | |||
* @return Collection|PointSaleDayInfoInterface[] | |||
*/ | |||
public function getPointSaleDayInfos(): Collection | |||
{ | |||
return $this->pointSaleDayInfos; | |||
} | |||
public function addPointSaleDayInfo(PointSaleDayInfoInterface $pointSaleDayInfo): self | |||
{ | |||
if (!$this->pointSaleDayInfos->contains($pointSaleDayInfo)) { | |||
$this->pointSaleDayInfos[] = $pointSaleDayInfo; | |||
$pointSaleDayInfo->setPointSale($this); | |||
} | |||
return $this; | |||
} | |||
public function removePointSaleDayInfo(PointSaleDayInfoInterface $pointSaleDayInfo): self | |||
{ | |||
if ($this->pointSaleDayInfos->contains($pointSaleDayInfo)) { | |||
$this->pointSaleDayInfos->removeElement($pointSaleDayInfo); | |||
// set the owning side to null (unless already changed) | |||
if ($pointSaleDayInfo->getPointSale() === $this) { | |||
$pointSaleDayInfo->setPointSale(null); | |||
} | |||
} | |||
return $this; | |||
} | |||
public function getAddress(): ?AddressInterface | |||
{ | |||
return $this->address; |
@@ -1,24 +0,0 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Repository; | |||
use Lc\SovBundle\Repository\AbstractRepositoryQuery as BaseAbstractRepositoryQuery; | |||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; | |||
use Doctrine\ORM\QueryBuilder; | |||
use Knp\Component\Pager\PaginatorInterface; | |||
use Lc\CaracoleBundle\Container\MyContainer; | |||
abstract class AbstractRepositoryQuery extends BaseAbstractRepositoryQuery | |||
{ | |||
public function __construct( | |||
MyContainer $container, | |||
ServiceEntityRepository $repository, | |||
string $id, | |||
PaginatorInterface $paginator = null | |||
) | |||
{ | |||
$this->container = $container; | |||
parent::__construct($repository, $id, $paginator); | |||
} | |||
} |
@@ -2,20 +2,17 @@ | |||
namespace Lc\CaracoleBundle\Repository\Address; | |||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; | |||
use App\Entity\Address\Address; | |||
use Doctrine\Persistence\ManagerRegistry; | |||
use Lc\CaracoleBundle\Model\Address\AddressInterface; | |||
use Lc\CaracoleBundle\Repository\MerchantRepositoryQueryTrait; | |||
use Lc\SovBundle\Repository\AbstractRepository; | |||
/** | |||
* @method AddressInterface|null find($id, $lockMode = null, $lockVersion = null) | |||
* @method AddressInterface|null findOneBy(array $criteria, array $orderBy = null) | |||
* @method AddressInterface[] findAll() | |||
* @method AddressInterface[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) | |||
*/ | |||
class AddressRepository extends ServiceEntityRepository | |||
class AddressRepository extends AbstractRepository | |||
{ | |||
use MerchantRepositoryQueryTrait; | |||
public function __construct(ManagerRegistry $registry) | |||
{ | |||
parent::__construct($registry, AddressInterface::class); | |||
parent::__construct($registry, Address::class); | |||
} | |||
} |
@@ -0,0 +1,17 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Repository\Address; | |||
use Knp\Component\Pager\PaginatorInterface; | |||
use Lc\CaracoleBundle\Repository\MerchantRepositoryQueryTrait; | |||
use Lc\SovBundle\Repository\AbstractRepositoryQuery; | |||
class AddressRepositoryQuery extends AbstractRepositoryQuery | |||
{ | |||
use MerchantRepositoryQueryTrait; | |||
public function __construct(AddressRepository $repository, PaginatorInterface $paginator) | |||
{ | |||
parent::__construct($repository, 'r', $paginator); | |||
} | |||
} |
@@ -0,0 +1,13 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Repository\Address; | |||
class AddressStore | |||
{ | |||
protected AddressRepositoryQuery $query; | |||
public function __construct(AddressRepositoryQuery $query) | |||
{ | |||
$this->query = $query; | |||
} | |||
} |
@@ -2,24 +2,14 @@ | |||
namespace Lc\CaracoleBundle\Repository\Config; | |||
use Lc\CaracoleBundle\Model\Config\TaxRateInterface; | |||
use Lc\CaracoleBundle\Repository\RepositoryTrait; | |||
use App\Entity\Config\TaxRate; | |||
use Doctrine\Persistence\ManagerRegistry; | |||
use Lc\SovBundle\Repository\AbstractRepository; | |||
/** | |||
* @method TaxRateInterface|null find($id, $lockMode = null, $lockVersion = null) | |||
* @method TaxRateInterface|null findOneBy(array $criteria, array $orderBy = null) | |||
* @method TaxRateInterface[] findAll() | |||
* @method TaxRateInterface[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) | |||
*/ | |||
class TaxRateRepository extends AbstractRepository | |||
{ | |||
use RepositoryTrait; | |||
public function getInterfaceClass() | |||
public function __construct(ManagerRegistry $registry) | |||
{ | |||
return TaxRateInterface::class; | |||
parent::__construct($registry, TaxRate::class); | |||
} | |||
} |
@@ -0,0 +1,14 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Repository\Config; | |||
use Knp\Component\Pager\PaginatorInterface; | |||
use Lc\SovBundle\Repository\AbstractRepositoryQuery; | |||
class TaxRateRepositoryQuery extends AbstractRepositoryQuery | |||
{ | |||
public function __construct(TaxRateRepository $repository, PaginatorInterface $paginator) | |||
{ | |||
parent::__construct($repository, 'r', $paginator); | |||
} | |||
} |
@@ -0,0 +1,13 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Repository\Config; | |||
class TaxRateStore | |||
{ | |||
protected TaxRateRepositoryQuery $query; | |||
public function __construct(TaxRateRepositoryQuery $query) | |||
{ | |||
$this->query = $query; | |||
} | |||
} |
@@ -2,25 +2,14 @@ | |||
namespace Lc\CaracoleBundle\Repository\Config; | |||
use Lc\CaracoleBundle\Model\Config\TaxRateInterface; | |||
use Lc\CaracoleBundle\Model\Config\UnitInterface; | |||
use Lc\CaracoleBundle\Repository\RepositoryTrait; | |||
use App\Entity\Config\Unit; | |||
use Doctrine\Persistence\ManagerRegistry; | |||
use Lc\SovBundle\Repository\AbstractRepository; | |||
/** | |||
* @method UnitInterface|null find($id, $lockMode = null, $lockVersion = null) | |||
* @method UnitInterface|null findOneBy(array $criteria, array $orderBy = null) | |||
* @method UnitInterface[] findAll() | |||
* @method UnitInterface[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) | |||
*/ | |||
class UnitRepository extends AbstractRepository | |||
{ | |||
use RepositoryTrait; | |||
public function getInterfaceClass() | |||
public function __construct(ManagerRegistry $registry) | |||
{ | |||
return UnitInterface::class; | |||
parent::__construct($registry, Unit::class); | |||
} | |||
} |
@@ -0,0 +1,14 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Repository\Config; | |||
use Knp\Component\Pager\PaginatorInterface; | |||
use Lc\SovBundle\Repository\AbstractRepositoryQuery; | |||
class UnitRepositoryQuery extends AbstractRepositoryQuery | |||
{ | |||
public function __construct(UnitRepository $repository, PaginatorInterface $paginator) | |||
{ | |||
parent::__construct($repository, 'r', $paginator); | |||
} | |||
} |
@@ -0,0 +1,13 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Repository\Config; | |||
class UnitStore | |||
{ | |||
protected UnitRepositoryQuery $query; | |||
public function __construct(UnitRepositoryQuery $query) | |||
{ | |||
$this->query = $query; | |||
} | |||
} |
@@ -1,21 +0,0 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Repository\Credit; | |||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; | |||
use Doctrine\Persistence\ManagerRegistry; | |||
use Lc\CaracoleBundle\Model\Credit\CreditConfigInterface; | |||
/** | |||
* @method CreditConfigInterface|null find($id, $lockMode = null, $lockVersion = null) | |||
* @method CreditConfigInterface|null findOneBy(array $criteria, array $orderBy = null) | |||
* @method CreditConfigInterface[] findAll() | |||
* @method CreditConfigInterface[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) | |||
*/ | |||
class CreditConfigRepository extends ServiceEntityRepository | |||
{ | |||
public function __construct(ManagerRegistry $registry) | |||
{ | |||
parent::__construct($registry, CreditConfigInterface::class); | |||
} | |||
} |
@@ -2,25 +2,14 @@ | |||
namespace Lc\CaracoleBundle\Repository\Credit; | |||
use Lc\CaracoleBundle\Model\Config\TaxRateInterface; | |||
use Lc\CaracoleBundle\Model\Credit\CreditHistoryInterface; | |||
use Lc\CaracoleBundle\Repository\RepositoryTrait; | |||
use App\Entity\Credit\CreditHistory; | |||
use Doctrine\Persistence\ManagerRegistry; | |||
use Lc\SovBundle\Repository\AbstractRepository; | |||
/** | |||
* @method CreditHistoryInterface|null find($id, $lockMode = null, $lockVersion = null) | |||
* @method CreditHistoryInterface|null findOneBy(array $criteria, array $orderBy = null) | |||
* @method CreditHistoryInterface[] findAll() | |||
* @method CreditHistoryInterface[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) | |||
*/ | |||
class CreditHistoryRepository extends AbstractRepository | |||
{ | |||
use RepositoryTrait; | |||
public function getInterfaceClass() | |||
public function __construct(ManagerRegistry $registry) | |||
{ | |||
return CreditHistoryInterface::class; | |||
parent::__construct($registry, CreditHistory::class); | |||
} | |||
} |
@@ -0,0 +1,14 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Repository\Credit; | |||
use Knp\Component\Pager\PaginatorInterface; | |||
use Lc\SovBundle\Repository\AbstractRepositoryQuery; | |||
class CreditHistoryRepositoryQuery extends AbstractRepositoryQuery | |||
{ | |||
public function __construct(CreditHistoryRepository $repository, PaginatorInterface $paginator) | |||
{ | |||
parent::__construct($repository, 'r', $paginator); | |||
} | |||
} |
@@ -0,0 +1,13 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Repository\Credit; | |||
class CreditHistoryStore | |||
{ | |||
protected CreditHistoryRepositoryQuery $query; | |||
public function __construct(CreditHistoryRepositoryQuery $query) | |||
{ | |||
$this->query = $query; | |||
} | |||
} |
@@ -2,20 +2,14 @@ | |||
namespace Lc\CaracoleBundle\Repository\File; | |||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; | |||
use App\Entity\File\Document; | |||
use Doctrine\Persistence\ManagerRegistry; | |||
use Lc\CaracoleBundle\Model\File\DocumentInterface; | |||
use Lc\SovBundle\Repository\AbstractRepository; | |||
/** | |||
* @method DocumentInterface|null find($id, $lockMode = null, $lockVersion = null) | |||
* @method DocumentInterface|null findOneBy(array $criteria, array $orderBy = null) | |||
* @method DocumentInterface[] findAll() | |||
* @method DocumentInterface[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) | |||
*/ | |||
class DocumentRepository extends ServiceEntityRepository | |||
class DocumentRepository extends AbstractRepository | |||
{ | |||
public function __construct(ManagerRegistry $registry) | |||
{ | |||
parent::__construct($registry, DocumentInterface::class); | |||
parent::__construct($registry, Document::class); | |||
} | |||
} |
@@ -0,0 +1,17 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Repository\File; | |||
use Knp\Component\Pager\PaginatorInterface; | |||
use Lc\CaracoleBundle\Repository\MerchantRepositoryQueryTrait; | |||
use Lc\SovBundle\Repository\AbstractRepositoryQuery; | |||
class DocumentRepositoryQuery extends AbstractRepositoryQuery | |||
{ | |||
use MerchantRepositoryQueryTrait; | |||
public function __construct(DocumentRepository $repository, PaginatorInterface $paginator) | |||
{ | |||
parent::__construct($repository, 'r', $paginator); | |||
} | |||
} |
@@ -0,0 +1,13 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Repository\File; | |||
class DocumentStore | |||
{ | |||
protected DocumentRepositoryQuery $query; | |||
public function __construct(DocumentRepositoryQuery $query) | |||
{ | |||
$this->query = $query; | |||
} | |||
} |
@@ -1,21 +0,0 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Repository\Merchant; | |||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; | |||
use Doctrine\Persistence\ManagerRegistry; | |||
use Lc\CaracoleBundle\Model\Merchant\MerchantConfigInterface; | |||
/** | |||
* @method MerchantConfigInterface|null find($id, $lockMode = null, $lockVersion = null) | |||
* @method MerchantConfigInterface|null findOneBy(array $criteria, array $orderBy = null) | |||
* @method MerchantConfigInterface[] findAll() | |||
* @method MerchantConfigInterface[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) | |||
*/ | |||
class MerchantConfigRepository extends ServiceEntityRepository | |||
{ | |||
public function __construct(ManagerRegistry $registry) | |||
{ | |||
parent::__construct($registry, MerchantConfigInterface::class); | |||
} | |||
} |
@@ -2,20 +2,14 @@ | |||
namespace Lc\CaracoleBundle\Repository\Merchant; | |||
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface; | |||
use App\Entity\Merchant\Merchant; | |||
use Doctrine\Persistence\ManagerRegistry; | |||
use Lc\SovBundle\Repository\AbstractRepository; | |||
/** | |||
* @method MerchantInterface|null find($id, $lockMode = null, $lockVersion = null) | |||
* @method MerchantInterface|null findOneBy(array $criteria, array $orderBy = null) | |||
* @method MerchantInterface[] findAll() | |||
* @method MerchantInterface[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) | |||
*/ | |||
class MerchantRepository extends AbstractRepository | |||
{ | |||
public function getInterfaceClass() | |||
public function __construct(ManagerRegistry $registry) | |||
{ | |||
return MerchantInterface::class; | |||
parent::__construct($registry, Merchant::class); | |||
} | |||
} |
@@ -0,0 +1,14 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Repository\Merchant; | |||
use Knp\Component\Pager\PaginatorInterface; | |||
use Lc\SovBundle\Repository\AbstractRepositoryQuery; | |||
class MerchantRepositoryQuery extends AbstractRepositoryQuery | |||
{ | |||
public function __construct(MerchantRepository $repository, PaginatorInterface $paginator) | |||
{ | |||
parent::__construct($repository, 'r', $paginator); | |||
} | |||
} |
@@ -0,0 +1,13 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Repository\Merchant; | |||
class MerchantStore | |||
{ | |||
protected MerchantRepositoryQuery $query; | |||
public function __construct(MerchantRepositoryQuery $query) | |||
{ | |||
$this->query = $query; | |||
} | |||
} |
@@ -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; | |||
} |
@@ -2,20 +2,14 @@ | |||
namespace Lc\CaracoleBundle\Repository\Order; | |||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; | |||
use App\Entity\Order\OrderPayment; | |||
use Doctrine\Persistence\ManagerRegistry; | |||
use Lc\CaracoleBundle\Model\Order\OrderPaymentInterface; | |||
use Lc\SovBundle\Repository\AbstractRepository; | |||
/** | |||
* @method OrderPaymentInterface|null find($id, $lockMode = null, $lockVersion = null) | |||
* @method OrderPaymentInterface|null findOneBy(array $criteria, array $orderBy = null) | |||
* @method OrderPaymentInterface[] findAll() | |||
* @method OrderPaymentInterface[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) | |||
*/ | |||
class OrderPaymentRepository extends ServiceEntityRepository | |||
class OrderPaymentRepository extends AbstractRepository | |||
{ | |||
public function __construct(ManagerRegistry $registry) | |||
{ | |||
parent::__construct($registry, OrderPaymentInterface::class); | |||
parent::__construct($registry, OrderPayment::class); | |||
} | |||
} |
@@ -0,0 +1,14 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Repository\Order; | |||
use Knp\Component\Pager\PaginatorInterface; | |||
use Lc\SovBundle\Repository\AbstractRepositoryQuery; | |||
class OrderPaymentRepositoryQuery extends AbstractRepositoryQuery | |||
{ | |||
public function __construct(OrderPaymentRepository $repository, PaginatorInterface $paginator) | |||
{ | |||
parent::__construct($repository, 'r', $paginator); | |||
} | |||
} |
@@ -0,0 +1,13 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Repository\Order; | |||
class OrderPaymentStore | |||
{ | |||
protected OrderPaymentRepositoryQuery $query; | |||
public function __construct(OrderPaymentRepositoryQuery $query) | |||
{ | |||
$this->query = $query; | |||
} | |||
} |