Pārlūkot izejas kodu

Section commune

packProduct
Guillaume pirms 3 gadiem
vecāks
revīzija
4b18a5fcc6
4 mainītis faili ar 29 papildinājumiem un 3 dzēšanām
  1. +3
    -3
      Controller/Section/SectionAdminController.php
  2. +19
    -0
      Model/Section/SectionModel.php
  3. +1
    -0
      Resources/translations/admin.fr.yaml
  4. +6
    -0
      Solver/Section/SectionSolver.php

+ 3
- 3
Controller/Section/SectionAdminController.php Parādīt failu

@@ -42,14 +42,14 @@ abstract class SectionAdminController extends AbstractAdminController
]
),
TextField::new('color')
->setRequired(true)
->hideOnIndex(),
->setRequired(true),
NumberField::new('position')
->hideOnForm()
->hideOnIndex(),
CKEditorField::new('description')
->hideOnIndex(),
BooleanField::new('isDefault', 'Section par défaut'),
BooleanField::new('isDefault'),
BooleanField::new('isCommon'),
StatusField::new('status'),
],
$this->getSeoPanel(),

+ 19
- 0
Model/Section/SectionModel.php Parādīt failu

@@ -21,6 +21,8 @@ use Lc\SovBundle\Doctrine\Pattern\AbstractFullEntity;
*/
abstract class SectionModel extends AbstractFullEntity implements FilterMerchantInterface
{
const DEVALIAS_COMMON = 'common';

/**
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Merchant\MerchantInterface", inversedBy="sections")
* @ORM\JoinColumn(nullable=false)
@@ -87,6 +89,11 @@ abstract class SectionModel extends AbstractFullEntity implements FilterMerchant
*/
protected $openings;

/**
* @ORM\Column(type="boolean", nullable=true)
*/
protected $isCommon;

public function __construct()
{
$this->productFamilies = new ArrayCollection();
@@ -394,4 +401,16 @@ abstract class SectionModel extends AbstractFullEntity implements FilterMerchant

return $this;
}

public function getIsCommon(): ?bool
{
return $this->isCommon;
}

public function setIsCommon(?bool $isCommon): self
{
$this->isCommon = $isCommon;

return $this;
}
}

+ 1
- 0
Resources/translations/admin.fr.yaml Parādīt failu

@@ -93,6 +93,7 @@ entity:
fields:
cycle: Cycle de vente
isDefault: Section par défaut
isCommon: Section commune
TaxRate:
label: Règle de taxe
label_plurial: Règles de taxes

+ 6
- 0
Solver/Section/SectionSolver.php Parādīt failu

@@ -3,9 +3,15 @@
namespace Lc\CaracoleBundle\Solver\Section;

use Lc\CaracoleBundle\Model\Section\SectionInterface;
use Lc\CaracoleBundle\Model\Section\SectionModel;

class SectionSolver
{
public function isSectionCommon(SectionInterface $section)
{
return $section->getDevAlias() == SectionModel::DEVALIAS_COMMON;
}

// @TODO : à voir si pertinent
public function getNewsletter(SectionInterface $section)
{

Notiek ielāde…
Atcelt
Saglabāt