|
- <?php
-
- namespace Lc\ShopBundle\Model;
-
- use App\Entity\User;
- use App\Entity\UserPointSale;
- use Doctrine\Common\Collections\ArrayCollection;
- use Doctrine\Common\Collections\Collection;
- use Doctrine\ORM\Mapping as ORM;
- use Lc\ShopBundle\Context\FilterMultipleMerchantsInterface;
- use Lc\ShopBundle\Context\OrderAmountMinInterface;
-
-
- abstract class PointSale extends AbstractDocumentEntity implements FilterMultipleMerchantsInterface, OrderAmountMinInterface
- {
-
- use OrderAmountMin;
-
-
- protected $merchants;
-
-
-
- protected $code;
-
-
-
- protected $pointSaleDayInfos;
-
-
-
- protected $address;
-
-
-
- protected $userPointSales;
-
-
- public function __construct()
- {
- $this->merchants = new ArrayCollection();
- $this->pointSaleDayInfos = new ArrayCollection();
- $this->userPointSales = new ArrayCollection();
- }
-
- public function __toString()
- {
- return $this->getTitle() ;
- }
-
- public function labelAdminChoice()
- {
- return $this->getTitle();
- }
-
-
-
- public function getMerchants(): Collection
- {
- return $this->merchants;
- }
-
- public function addMerchant(Merchant $merchant): self
- {
- if (!$this->merchants->contains($merchant)) {
- $this->merchants[] = $merchant;
- }
-
- return $this;
- }
-
- public function removeMerchant(Merchant $merchant): self
- {
- if ($this->merchants->contains($merchant)) {
- $this->merchants->removeElement($merchant);
- }
-
- return $this;
- }
-
- public function getCode(): ?string
- {
- return $this->code;
- }
-
- public function setCode(?string $code): self
- {
- $this->code = $code;
-
- return $this;
- }
-
-
-
- public function getPointSaleDayInfos(): Collection
- {
- return $this->pointSaleDayInfos;
- }
-
- public function addPointSaleDayInfo(PointSaleDayInfo $pointSaleDayInfo): self
- {
- if (!$this->pointSaleDayInfos->contains($pointSaleDayInfo)) {
- $this->pointSaleDayInfos[] = $pointSaleDayInfo;
- $pointSaleDayInfo->setPointSale($this);
- }
-
- return $this;
- }
-
- public function removePointSaleDayInfo(PointSaleDayInfo $pointSaleDayInfo): self
- {
- if ($this->pointSaleDayInfos->contains($pointSaleDayInfo)) {
- $this->pointSaleDayInfos->removeElement($pointSaleDayInfo);
-
- if ($pointSaleDayInfo->getPointSale() === $this) {
- $pointSaleDayInfo->setPointSale(null);
- }
- }
-
- return $this;
- }
-
- public function getAddress(): ?Address
- {
- return $this->address;
- }
-
- public function setAddress(Address $address): self
- {
- $this->address = $address;
-
- return $this;
- }
-
-
-
- public function getUserPointSales(): Collection
- {
- return $this->userPointSales;
- }
-
- public function addUserPointSale(UserPointSale $userPointSale): self
- {
- if (!$this->userPointSales->contains($userPointSale)) {
- $this->userPointSales[] = $userPointSale;
- $userPointSale->setPointSale($this);
- }
-
- return $this;
- }
-
- public function removeUserPointSale(UserPointSale $userPointSale): self
- {
- if ($this->userPointSales->contains($userPointSale)) {
- $this->userPointSales->removeElement($userPointSale);
-
- if ($userPointSale->getPointSale() === $this) {
- $userPointSale->setPointSale(null);
- }
- }
-
- return $this;
- }
- }
|