|
- <?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\FilterMerchantInterface;
- use Lc\CaracoleBundle\Doctrine\Extension\OrderAmountMinInterface;
- use Lc\CaracoleBundle\Doctrine\Extension\OrderAmountMinTrait;
- use Lc\CaracoleBundle\Doctrine\Extension\ReductionCartPropertyInterface;
- use Lc\CaracoleBundle\Doctrine\Extension\ReductionCartPropertyTrait;
- use Lc\CaracoleBundle\Doctrine\Extension\ReductionInterface;
- 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\PointSale\PointSaleInterface;
- use Lc\SovBundle\Doctrine\Extension\StatusInterface;
- use Lc\SovBundle\Doctrine\Extension\StatusTrait;
- use Lc\SovBundle\Doctrine\Pattern\AbstractLightEntity;
-
-
- abstract class ReductionCartModel extends AbstractLightEntity implements ReductionPropertyInterface, ReductionInterface,
- ReductionCartPropertyInterface,
- FilterMerchantInterface,
- OrderAmountMinInterface,
- StatusInterface, ReductionCartInterface
- {
- use StatusTrait;
- use OrderAmountMinTrait;
- use ReductionTrait;
- use ReductionCartPropertyTrait;
- use ReductionPropertyTrait {
- ReductionPropertyTrait::__construct as private __reductionPropertyConstruct;
- }
-
- const APPLIED_TO_DELIVERY = 'delivery';
- const APPLIED_TO_ORDER_PRODUCTS = 'order-products';
-
-
-
- protected $title;
-
-
-
- protected $merchant;
-
-
-
- protected $codes = [];
-
-
-
- protected $availableQuantity;
-
-
-
- protected $availableQuantityPerUser;
-
-
-
- protected $pointSales;
-
-
-
- protected $uncombinables;
-
-
-
- protected $uncombinableTypes = [];
-
-
-
- protected $availableQuantityPerCode;
-
- public function __toString()
- {
- return $this->title;
- }
-
- public function __construct()
- {
- $this->__reductionPropertyConstruct();
- $this->pointSales = new ArrayCollection();
- $this->uncombinables = new ArrayCollection();
- }
-
- public function getTitle(): ?string
- {
- return $this->title;
- }
-
- public function setTitle(string $title): self
- {
- $this->title = $title;
-
- return $this;
- }
-
- public function getMerchant(): MerchantInterface
- {
- return $this->merchant;
- }
-
- public function setMerchant(MerchantInterface $merchant): self
- {
- $this->merchant = $merchant;
-
- return $this;
- }
-
- public function getCodes(): ?array
- {
- return $this->codes;
- }
-
- public function setCodes(?array $codes): self
- {
- $this->codes = $codes;
-
- return $this;
- }
-
-
-
- public function getPointSales(): Collection
- {
- return $this->pointSales;
- }
-
- public function addPointSale(PointSaleInterface $pointSale): self
- {
- if (!$this->pointSales->contains($pointSale)) {
- $this->pointSales[] = $pointSale;
- }
-
- return $this;
- }
-
- public function removePointSale(PointSaleInterface $pointSale): self
- {
- if ($this->pointSales->contains($pointSale)) {
- $this->pointSales->removeElement($pointSale);
- }
-
- return $this;
- }
-
- public function getAvailableQuantity(): ?int
- {
- return $this->availableQuantity;
- }
-
- public function setAvailableQuantity(int $availableQuantity): self
- {
- $this->availableQuantity = $availableQuantity;
-
- return $this;
- }
-
- public function getAvailableQuantityPerUser(): ?int
- {
- return $this->availableQuantityPerUser;
- }
-
- public function setAvailableQuantityPerUser(int $availableQuantityPerUser): self
- {
- $this->availableQuantityPerUser = $availableQuantityPerUser;
-
- return $this;
- }
-
-
-
- public function getUncombinables(): Collection
- {
- return $this->uncombinables;
- }
-
- public function addUncombinable(ReductionCartInterface $uncombinable): self
- {
- if (!$this->uncombinables->contains($uncombinable)) {
- $this->uncombinables[] = $uncombinable;
- }
-
- return $this;
- }
-
- public function removeUncombinables(ReductionCartInterface $uncombinable): self
- {
- if ($this->uncombinables->contains($uncombinable)) {
- $this->uncombinables->removeElement($uncombinable);
- }
-
- return $this;
- }
-
- public function getUncombinableTypes(): ?array
- {
- return $this->uncombinableTypes;
- }
-
- public function setUncombinableTypes(?array $uncombinableTypes): self
- {
- $this->uncombinableTypes = $uncombinableTypes;
-
- return $this;
- }
-
- public function getAvailableQuantityPerCode(): ?int
- {
- return $this->availableQuantityPerCode;
- }
-
- public function setAvailableQuantityPerCode(int $availableQuantityPerCode): self
- {
- $this->availableQuantityPerCode = $availableQuantityPerCode;
-
- return $this;
- }
-
- }
|