|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204 |
- <?php
-
- namespace Lc\ShopBundle\Model;
-
- use Doctrine\Common\Collections\ArrayCollection;
- use Doctrine\Common\Collections\Collection;
- use Doctrine\ORM\Mapping as ORM;
- use Lc\ShopBundle\Context\FilterMerchantInterface;
- use Lc\ShopBundle\Context\ReductionCatalogInterface;
- use Lc\ShopBundle\Context\ReductionInterface;
- use phpDocumentor\Reflection\Types\Integer;
-
- /**
- * @ORM\MappedSuperclass()
- */
- abstract class ReductionCatalog extends AbstractDocumentEntity implements ReductionCatalogInterface, FilterMerchantInterface
- {
- use ReductionTrait;
- use ReductionPropertyTrait ;
-
- /**
- * @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\MerchantInterface", inversedBy="productFamilies")
- * @ORM\JoinColumn(nullable=false)
- */
- protected $merchant;
-
- /**
- * @ORM\ManyToMany(targetEntity="Lc\ShopBundle\Context\ProductFamilyInterface")
- */
- protected $productFamilies;
-
- /**
- * @ORM\OneToOne(targetEntity="Lc\ShopBundle\Context\ProductFamilyInterface")
- */
- protected $productFamily;
-
- /**
- * @ORM\ManyToMany(targetEntity="Lc\ShopBundle\Context\ProductCategoryInterface")
- */
- protected $productCategories;
-
- /**
- * @ORM\ManyToMany(targetEntity="Lc\ShopBundle\Context\GroupUserInterface")
- */
- protected $groupUsers;
-
- /**
- * @ORM\ManyToMany(targetEntity="Lc\ShopBundle\Context\UserInterface")
- */
- protected $users;
-
-
-
- public function __construct()
- {
- $this->productFamilies = new ArrayCollection();
- $this->groupUsers = new ArrayCollection();
- $this->productCategories = new ArrayCollection();
- $this->users = new ArrayCollection();
- }
-
- public function getMerchant(): ?Merchant
- {
- return $this->merchant;
- }
-
- public function setMerchant(?Merchant $merchant): self
- {
- $this->merchant = $merchant;
-
- return $this;
- }
-
-
- /**
- * @return Collection|ProductFamily[]
- */
- public function getProductFamilies(): Collection
- {
- return $this->productFamilies;
- }
-
- public function addProductFamily(ProductFamily $productFamily): self
- {
- if (!$this->productFamilies->contains($productFamily)) {
- $this->productFamilies[] = $productFamily;
- }
-
- return $this;
- }
-
- public function removeProductFamily(ProductFamily $productFamily): self
- {
- if ($this->productFamilies->contains($productFamily)) {
- $this->productFamilies->removeElement($productFamily);
- }
-
- return $this;
- }
-
-
- public function getProductFamily(): ?ProductFamily
- {
- return $this->productFamily;
- }
-
- public function setProductFamily(?ProductFamily $productFamily): self
- {
- $this->productFamily = $productFamily;
-
- return $this;
- }
-
- /**
- * @return Collection|GroupUser[]
- */
- public function getGroupUsers(): Collection
- {
- return $this->groupUsers;
- }
-
- public function addGroupUser(GroupUser $groupUser): self
- {
- if (!$this->groupUsers->contains($groupUser)) {
- $this->groupUsers[] = $groupUser;
- }
-
- return $this;
- }
-
- public function removeGroupUser(GroupUser $groupUser): self
- {
- if ($this->groupUsers->contains($groupUser)) {
- $this->groupUsers->removeElement($groupUser);
- }
-
- return $this;
- }
-
- /**
- * @return Collection|ProductCategory[]
- */
- public function getProductCategories(): Collection
- {
- return $this->productCategories;
- }
-
- public function addProductCategory(ProductCategory $productCategory): self
- {
- if (!$this->productCategories->contains($productCategory)) {
- $this->productCategories[] = $productCategory;
- }
-
- return $this;
- }
-
- public function removeProductCategory(ProductCategory $productCategory): self
- {
- if ($this->productCategories->contains($productCategory)) {
- $this->productCategories->removeElement($productCategory);
- }
-
- return $this;
- }
-
- /**
- * @return Collection|User[]
- */
- public function getUsers(): Collection
- {
- return $this->users;
- }
-
- public function addUser(User $user): self
- {
- if (!$this->users->contains($user)) {
- $this->users[] = $user;
- }
-
- return $this;
- }
-
- public function removeUser(User $user): self
- {
- if ($this->users->contains($user)) {
- $this->users->removeElement($user);
- }
-
- return $this;
- }
-
- /*public function getFromQuantity(): ?int
- {
- return $this->fromQuantity;
- }
-
- public function setFromQuantity(int $fromQuantity): self
- {
- $this->fromQuantity = $fromQuantity;
-
- return $this;
- }*/
-
- }
|