瀏覽代碼

Section commune

packProduct
Guillaume 3 年之前
父節點
當前提交
4b18a5fcc6
共有 4 個文件被更改,包括 29 次插入3 次删除
  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 查看文件

@@ -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 查看文件

@@ -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 查看文件

@@ -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 查看文件

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

Loading…
取消
儲存