소스 검색

Settings : adaptation factory

packProduct
Guillaume 3 년 전
부모
커밋
5047a6c952
6개의 변경된 파일9개의 추가작업 그리고 13개의 파일을 삭제
  1. +1
    -6
      EventSubscriber/SettingEventSubscriber.php
  2. +1
    -0
      Factory/Section/OpeningFactory.php
  3. +3
    -3
      Factory/Setting/MerchantSettingFactory.php
  4. +3
    -3
      Factory/Setting/SectionSettingFactory.php
  5. +1
    -0
      Model/Section/SectionModel.php
  6. +0
    -1
      Resolver/SectionResolver.php

+ 1
- 6
EventSubscriber/SettingEventSubscriber.php 파일 보기

@@ -80,11 +80,6 @@ class SettingEventSubscriber implements EventSubscriberInterface
}

if ($createEntitySetting) {
if ($type == 'section') {
$factory->setSection($entity);
} elseif ($type == 'merchant') {
$factory->setMerchant($entity);
}

$text = null;
$date = null;
@@ -100,7 +95,7 @@ class SettingEventSubscriber implements EventSubscriberInterface
$file = $fieldValue;
}

$entitySetting = $factory->create($setting['name'], $text, $date, $file);
$entitySetting = $factory->create($entity, $setting['name'], $text, $date, $file);

$this->em->persist($entitySetting);
}

+ 1
- 0
Factory/Section/OpeningFactory.php 파일 보기

@@ -20,6 +20,7 @@ class OpeningFactory extends AbstractFactory implements OpeningFactoryInterface
$opening = new Opening();

$opening->setSection($this->section);
$opening->setDay($day);
$opening->setTimeStart($timeStart);
$opening->setTimeEnd($timeEnd);
$opening->setGroupUser($groupUser);

+ 3
- 3
Factory/Setting/MerchantSettingFactory.php 파일 보기

@@ -4,18 +4,18 @@ namespace Lc\CaracoleBundle\Factory\Setting;

use App\Entity\Setting\MerchantSetting;
use Lc\CaracoleBundle\Factory\MerchantFactoryTrait;
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\SovBundle\Factory\AbstractFactory;
use Lc\SovBundle\Model\File\FileInterface;

class MerchantSettingFactory extends AbstractFactory
{
use MerchantFactoryTrait;

public function create(string $name, string $text = null, \DateTime $date = null, FileInterface $file = null)
public function create(MerchantInterface $merchant, string $name, string $text = null, \DateTime $date = null, FileInterface $file = null)
{
$merchantSetting = new MerchantSetting();

$merchantSetting->setMerchant($this->merchant);
$merchantSetting->setMerchant($merchant);
$merchantSetting->setName($name);
$merchantSetting->setText($text);
$merchantSetting->setDate($date);

+ 3
- 3
Factory/Setting/SectionSettingFactory.php 파일 보기

@@ -4,18 +4,18 @@ namespace Lc\CaracoleBundle\Factory\Setting;

use App\Entity\Setting\SectionSetting;
use Lc\CaracoleBundle\Factory\SectionFactoryTrait;
use Lc\CaracoleBundle\Model\Section\SectionInterface;
use Lc\SovBundle\Factory\AbstractFactory;
use Lc\SovBundle\Model\File\FileInterface;

class SectionSettingFactory extends AbstractFactory
{
use SectionFactoryTrait;

public function create(string $name, string $text = null, \DateTime $date = null, FileInterface $file = null)
public function create(SectionInterface $section, string $name, string $text = null, \DateTime $date = null, FileInterface $file = null)
{
$merchantSetting = new SectionSetting();

$merchantSetting->setSection($this->section);
$merchantSetting->setSection($section);
$merchantSetting->setName($name);
$merchantSetting->setText($text);
$merchantSetting->setDate($date);

+ 1
- 0
Model/Section/SectionModel.php 파일 보기

@@ -84,6 +84,7 @@ abstract class SectionModel extends AbstractFullEntity implements FilterMerchant
$this->productFamilies = new ArrayCollection();
$this->orderShops = new ArrayCollection();
$this->openings = new ArrayCollection();
$this->productCategories = new ArrayCollection();
}

public function __toString()

+ 0
- 1
Resolver/SectionResolver.php 파일 보기

@@ -3,7 +3,6 @@
* @author La clic ! <contact@laclic.fr>
*/


namespace Lc\CaracoleBundle\Resolver;

use Doctrine\ORM\EntityManagerInterface;

Loading…
취소
저장