@@ -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(), |
@@ -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; | |||
} | |||
} |
@@ -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 |
@@ -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) | |||
{ |