Browse Source

Adaptations setting sections

packProduct
Guillaume 3 years ago
parent
commit
6ea7de74b5
5 changed files with 11 additions and 44 deletions
  1. +1
    -1
      Definition/SectionSettingDefinition.php
  2. +0
    -10
      Definition/SectionSettingDefinitionInterface.php
  3. +2
    -14
      EventSubscriber/OpeningEventSubscriber.php
  4. +3
    -5
      EventSubscriber/SettingEventSubscriber.php
  5. +5
    -14
      Form/Setting/BaseSettingType.php

+ 1
- 1
Definition/SectionSettingDefinition.php View File



use Lc\SovBundle\Definition\AbstractSettingDefinition; use Lc\SovBundle\Definition\AbstractSettingDefinition;


class SectionSettingDefinition extends AbstractSettingDefinition implements SectionSettingDefinitionInterface
class SectionSettingDefinition extends AbstractSettingDefinition
{ {
const CATEGORY_GENERAL = 'general'; const CATEGORY_GENERAL = 'general';



+ 0
- 10
Definition/SectionSettingDefinitionInterface.php View File

<?php


namespace Lc\CaracoleBundle\Definition;


interface SectionSettingDefinitionInterface
{

}

+ 2
- 14
EventSubscriber/OpeningEventSubscriber.php View File

namespace Lc\CaracoleBundle\EventSubscriber; namespace Lc\CaracoleBundle\EventSubscriber;


use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
use Lc\CaracoleBundle\Definition\MerchantSettingDefinitionInterface;
use Lc\CaracoleBundle\Factory\Setting\MerchantSettingFactory;
use Lc\CaracoleBundle\Factory\Setting\SectionSettingFactory;
use Lc\CaracoleBundle\Model\Section\SectionInterface;
use Lc\CaracoleBundle\Definition\SectionSettingDefinitionInterface;
use Lc\CaracoleBundle\Repository\Merchant\MerchantRepository;
use Lc\CaracoleBundle\Repository\Section\OpeningRepositoryQuery;
use Lc\CaracoleBundle\Repository\Section\SectionRepository;
use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\HttpKernel\KernelEvents;


class OpeningEventSubscriber implements EventSubscriberInterface class OpeningEventSubscriber implements EventSubscriberInterface
{ {
protected $entityManager;
protected $openingRepositoryQuery;
protected EntityManagerInterface $entityManager;


public function __construct( public function __construct(
EntityManagerInterface $entityManager,
OpeningRepositoryQuery $openingRepositoryQuery
EntityManagerInterface $entityManager
) { ) {
$this->entityManager = $entityManager; $this->entityManager = $entityManager;
$this->openingRepositoryQuery = $openingRepositoryQuery;
} }


public static function getSubscribedEvents() public static function getSubscribedEvents()


public function initOpenings() public function initOpenings()
{ {

} }


} }

+ 3
- 5
EventSubscriber/SettingEventSubscriber.php View File



use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
use Lc\CaracoleBundle\Definition\MerchantSettingDefinitionInterface; use Lc\CaracoleBundle\Definition\MerchantSettingDefinitionInterface;
use Lc\CaracoleBundle\Definition\SectionSettingDefinition;
use Lc\CaracoleBundle\Factory\Setting\MerchantSettingFactory; use Lc\CaracoleBundle\Factory\Setting\MerchantSettingFactory;
use Lc\CaracoleBundle\Factory\Setting\SectionSettingFactory; use Lc\CaracoleBundle\Factory\Setting\SectionSettingFactory;
use Lc\CaracoleBundle\Model\Section\SectionInterface; use Lc\CaracoleBundle\Model\Section\SectionInterface;
use Lc\CaracoleBundle\Definition\SectionSettingDefinitionInterface;
use Lc\CaracoleBundle\Repository\Merchant\MerchantRepository;
use Lc\CaracoleBundle\Repository\Merchant\MerchantStore; use Lc\CaracoleBundle\Repository\Merchant\MerchantStore;
use Lc\CaracoleBundle\Repository\Section\SectionRepository;
use Lc\CaracoleBundle\Repository\Section\SectionStore; use Lc\CaracoleBundle\Repository\Section\SectionStore;
use Lc\SovBundle\Solver\Setting\SettingSolver; use Lc\SovBundle\Solver\Setting\SettingSolver;
use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface;
{ {
protected EntityManagerInterface $entityManager; protected EntityManagerInterface $entityManager;
protected MerchantSettingDefinitionInterface $merchantSettingDefinition; protected MerchantSettingDefinitionInterface $merchantSettingDefinition;
protected SectionSettingDefinitionInterface $sectionSettingDefinition;
protected SectionSettingDefinition $sectionSettingDefinition;
protected MerchantStore $merchantStore; protected MerchantStore $merchantStore;
protected SectionStore $sectionStore; protected SectionStore $sectionStore;
protected MerchantSettingFactory $merchantSettingFactory; protected MerchantSettingFactory $merchantSettingFactory;
public function __construct( public function __construct(
EntityManagerInterface $entityManager, EntityManagerInterface $entityManager,
MerchantSettingDefinitionInterface $merchantSettingDefinition, MerchantSettingDefinitionInterface $merchantSettingDefinition,
SectionSettingDefinitionInterface $sectionSettingDefinition,
SectionSettingDefinition $sectionSettingDefinition,
MerchantStore $merchantStore, MerchantStore $merchantStore,
SectionStore $sectionStore, SectionStore $sectionStore,
MerchantSettingFactory $merchantSettingFactory, MerchantSettingFactory $merchantSettingFactory,

+ 5
- 14
Form/Setting/BaseSettingType.php View File



namespace Lc\CaracoleBundle\Form\Setting; namespace Lc\CaracoleBundle\Form\Setting;


use FOS\CKEditorBundle\Form\Type\CKEditorType;
use Lc\CaracoleBundle\Definition\MerchantSettingDefinitionInterface; use Lc\CaracoleBundle\Definition\MerchantSettingDefinitionInterface;
use Lc\CaracoleBundle\Definition\SectionSettingDefinition;
use Lc\CaracoleBundle\Model\Setting\MerchantSettingInterface; use Lc\CaracoleBundle\Model\Setting\MerchantSettingInterface;
use Lc\CaracoleBundle\Model\Setting\SectionSettingInterface; use Lc\CaracoleBundle\Model\Setting\SectionSettingInterface;
use Lc\CaracoleBundle\Definition\SectionSettingDefinitionInterface;
use Lc\SovBundle\Form\Common\FileManagerType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\DateType;
use Symfony\Component\Form\Extension\Core\Type\HiddenType; use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\TimeType;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormEvent; use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents; use Symfony\Component\Form\FormEvents;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Lc\SovBundle\Form\Setting\BaseSettingType as SovBaseSettingType; use Lc\SovBundle\Form\Setting\BaseSettingType as SovBaseSettingType;


abstract class BaseSettingType extends SovBaseSettingType abstract class BaseSettingType extends SovBaseSettingType
{ {
protected $em;
protected $merchantSettingDefinition;
protected $sectionSettingDefinition;
protected EntityManagerInterface $em;
protected MerchantSettingDefinitionInterface $merchantSettingDefinition;
protected SectionSettingDefinition $sectionSettingDefinition;


public function __construct( public function __construct(
EntityManagerInterface $entityManager, EntityManagerInterface $entityManager,
MerchantSettingDefinitionInterface $merchantSettingDefinition, MerchantSettingDefinitionInterface $merchantSettingDefinition,
SectionSettingDefinitionInterface $sectionSettingDefinition
SectionSettingDefinition $sectionSettingDefinition
) { ) {
$this->em = $entityManager; $this->em = $entityManager;
$this->merchantSettingDefinition = $merchantSettingDefinition; $this->merchantSettingDefinition = $merchantSettingDefinition;

Loading…
Cancel
Save