] | ] | ||||
), | ), | ||||
TextField::new('color') | TextField::new('color') | ||||
->setRequired(true) | |||||
->hideOnIndex(), | |||||
->setRequired(true), | |||||
NumberField::new('position') | NumberField::new('position') | ||||
->hideOnForm() | ->hideOnForm() | ||||
->hideOnIndex(), | ->hideOnIndex(), | ||||
CKEditorField::new('description') | CKEditorField::new('description') | ||||
->hideOnIndex(), | ->hideOnIndex(), | ||||
BooleanField::new('isDefault', 'Section par défaut'), | |||||
BooleanField::new('isDefault'), | |||||
BooleanField::new('isCommon'), | |||||
StatusField::new('status'), | StatusField::new('status'), | ||||
], | ], | ||||
$this->getSeoPanel(), | $this->getSeoPanel(), |
*/ | */ | ||||
abstract class SectionModel extends AbstractFullEntity implements FilterMerchantInterface | abstract class SectionModel extends AbstractFullEntity implements FilterMerchantInterface | ||||
{ | { | ||||
const DEVALIAS_COMMON = 'common'; | |||||
/** | /** | ||||
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Merchant\MerchantInterface", inversedBy="sections") | * @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Merchant\MerchantInterface", inversedBy="sections") | ||||
* @ORM\JoinColumn(nullable=false) | * @ORM\JoinColumn(nullable=false) | ||||
*/ | */ | ||||
protected $openings; | protected $openings; | ||||
/** | |||||
* @ORM\Column(type="boolean", nullable=true) | |||||
*/ | |||||
protected $isCommon; | |||||
public function __construct() | public function __construct() | ||||
{ | { | ||||
$this->productFamilies = new ArrayCollection(); | $this->productFamilies = new ArrayCollection(); | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getIsCommon(): ?bool | |||||
{ | |||||
return $this->isCommon; | |||||
} | |||||
public function setIsCommon(?bool $isCommon): self | |||||
{ | |||||
$this->isCommon = $isCommon; | |||||
return $this; | |||||
} | |||||
} | } |
fields: | fields: | ||||
cycle: Cycle de vente | cycle: Cycle de vente | ||||
isDefault: Section par défaut | isDefault: Section par défaut | ||||
isCommon: Section commune | |||||
TaxRate: | TaxRate: | ||||
label: Règle de taxe | label: Règle de taxe | ||||
label_plurial: Règles de taxes | label_plurial: Règles de taxes |
namespace Lc\CaracoleBundle\Solver\Section; | namespace Lc\CaracoleBundle\Solver\Section; | ||||
use Lc\CaracoleBundle\Model\Section\SectionInterface; | use Lc\CaracoleBundle\Model\Section\SectionInterface; | ||||
use Lc\CaracoleBundle\Model\Section\SectionModel; | |||||
class SectionSolver | class SectionSolver | ||||
{ | { | ||||
public function isSectionCommon(SectionInterface $section) | |||||
{ | |||||
return $section->getDevAlias() == SectionModel::DEVALIAS_COMMON; | |||||
} | |||||
// @TODO : à voir si pertinent | // @TODO : à voir si pertinent | ||||
public function getNewsletter(SectionInterface $section) | public function getNewsletter(SectionInterface $section) | ||||
{ | { |