|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 |
- <?php
-
- namespace Lc\CaracoleBundle\Model\Reduction;
-
- use Doctrine\Common\Collections\ArrayCollection;
- use Doctrine\Common\Collections\Collection;
- use Doctrine\ORM\Mapping as ORM;
- use Lc\CaracoleBundle\Doctrine\Extension\FilterSectionInterface;
- use Lc\CaracoleBundle\Doctrine\Extension\ReductionPropertyTrait;
- use Lc\CaracoleBundle\Doctrine\Extension\ReductionTrait;
- use Lc\CaracoleBundle\Doctrine\Extension\ReductionPropertyInterface;
- use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
- use Lc\CaracoleBundle\Model\Product\ProductCategoryInterface;
- use Lc\CaracoleBundle\Model\Product\ProductFamilyInterface;
- use Lc\CaracoleBundle\Model\Product\ProductFamilyModel;
- use Lc\CaracoleBundle\Model\Section\SectionInterface;
- use Lc\SovBundle\Doctrine\Extension\StatusInterface;
- use Lc\SovBundle\Doctrine\Extension\StatusTrait;
- use Lc\SovBundle\Doctrine\Pattern\AbstractLightEntity;
-
- /**
- * @ORM\MappedSuperclass()
- */
- abstract class ReductionCatalogModel extends AbstractLightEntity implements ReductionCatalogInterface,
- ReductionPropertyInterface,
- FilterSectionInterface, StatusInterface
- {
- use StatusTrait;
- use ReductionTrait;
- use ReductionPropertyTrait {
- ReductionPropertyTrait::__construct as private __reductionPropertyConstruct;
- }
-
- /**
- * @ORM\Column(type="string", length=255)
- */
- protected $title;
-
- /**
- * @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Section\SectionInterface")
- * @ORM\JoinColumn(nullable=false)
- */
- protected $section;
-
- /**
- * @ORM\ManyToMany(targetEntity="Lc\CaracoleBundle\Model\Product\ProductFamilyInterface")
- */
- protected $productFamilies;
-
- /**
- * @ORM\OneToOne(targetEntity="Lc\CaracoleBundle\Model\Product\ProductFamilyInterface")
- */
- protected $productFamily;
-
- /**
- * @ORM\ManyToMany(targetEntity="Lc\CaracoleBundle\Model\Product\ProductCategoryInterface")
- */
- protected $productCategories;
-
- public function __construct()
- {
- $this->__reductionPropertyConstruct();
- $this->productFamilies = new ArrayCollection();
- $this->productCategories = new ArrayCollection();
- }
-
- public function getTitle(): ?string
- {
- return $this->title;
- }
-
- public function setTitle(string $title): self
- {
- $this->title = $title;
-
- return $this;
- }
-
- public function getSection(): SectionInterface
- {
- return $this->section;
- }
-
- public function setSection(SectionInterface $section): self
- {
- $this->section = $section;
-
- return $this;
- }
-
- /**
- * @return Collection|ProductFamilyInterface[]
- */
- public function getProductFamilies(): Collection
- {
- return $this->productFamilies;
- }
-
- public function addProductFamily(ProductFamilyInterface $productFamily): self
- {
- if (!$this->productFamilies->contains($productFamily)) {
- $this->productFamilies[] = $productFamily;
- }
-
- return $this;
- }
-
- public function removeProductFamily(ProductFamilyInterface $productFamily): self
- {
- if ($this->productFamilies->contains($productFamily)) {
- $this->productFamilies->removeElement($productFamily);
- }
-
- return $this;
- }
-
- public function getProductFamily(): ?ProductFamilyInterface
- {
- return $this->productFamily;
- }
-
- public function setProductFamily(?ProductFamilyInterface $productFamily): self
- {
- $this->productFamily = $productFamily;
-
- return $this;
- }
-
- /**
- * @return Collection|ProductCategoryInterface[]
- */
- public function getProductCategories(): Collection
- {
- return $this->productCategories;
- }
-
- public function addProductCategory(ProductCategoryInterface $productCategory): self
- {
- if (!$this->productCategories->contains($productCategory)) {
- $this->productCategories[] = $productCategory;
- }
-
- return $this;
- }
-
- public function removeProductCategory(ProductCategoryInterface $productCategory): self
- {
- if ($this->productCategories->contains($productCategory)) {
- $this->productCategories->removeElement($productCategory);
- }
-
- return $this;
- }
-
- }
|