|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- <?php
-
- namespace Lc\ShopBundle\Model;
-
- use App\Entity\OrderShop;
- use Doctrine\Common\Collections\ArrayCollection;
- use Doctrine\Common\Collections\Collection;
- use Doctrine\ORM\Mapping as ORM;
-
- /**
- * @ORM\MappedSuperclass()
- */
- abstract class DocumentQuotation extends AbstractDocumentOrder
- {
-
- /**
- * @ORM\Column(type="integer", nullable=true)
- */
- protected $duration;
-
- /**
- * @ORM\OneToMany(targetEntity="Lc\ShopBundle\Context\OrderShopInterface", mappedBy="documentQuotation")
- */
- protected $orderShops;
-
- public function __construct()
- {
- $this->orderShops = new ArrayCollection();
- }
-
- public function getDuration(): ?int
- {
- return $this->duration;
- }
-
- public function setDuration(?int $duration): self
- {
- $this->duration = $duration;
-
- return $this;
- }
-
- /**
- * @return Collection|OrderShop[]
- */
- public function getOrderShops(): Collection
- {
- return $this->orderShops;
- }
-
- public function addOrderShop(OrderShop $orderShop): self
- {
- if (!$this->orderShops->contains($orderShop)) {
- $this->orderShops[] = $orderShop;
- $orderShop->setDocumentQuotation($this);
- }
-
- return $this;
- }
-
- public function removeOrderShop(OrderShop $orderShop): self
- {
- if ($this->orderShops->contains($orderShop)) {
- $this->orderShops->removeElement($orderShop);
- // set the owning side to null (unless already changed)
- if ($orderShop->getDocumentQuotation() === $this) {
- $orderShop->setDocumentQuotation(null);
- }
- }
-
- return $this;
- }
- }
|