Ви не можете вибрати більше 25 тем
Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
|
- <?php
-
- namespace Lc\ShopBundle\Model;
-
- use Lc\ShopBundle\Model\OrderShop;
- use Doctrine\Common\Collections\ArrayCollection;
- use Doctrine\Common\Collections\Collection;
- use Doctrine\ORM\Mapping as ORM;
-
- /**
- * @ORM\MappedSuperclass()
- */
- abstract class DocumentInvoice extends AbstractDocumentOrder
- {
- /**
- * @ORM\OneToMany(targetEntity="Lc\ShopBundle\Context\OrderShopInterface", mappedBy="documentInvoice")
- */
- protected $orderShops;
-
- public function __construct()
- {
- $this->orderShops = new ArrayCollection();
- }
-
- /**
- * @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->setDocumentInvoice($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->getDocumentInvoice() === $this) {
- $orderShop->setDocumentInvoice(null);
- }
- }
-
- return $this;
- }
-
- }
|