|
|
@@ -56,6 +56,11 @@ abstract class Merchant extends AbstractDocumentEntity |
|
|
|
*/ |
|
|
|
protected $news; |
|
|
|
|
|
|
|
/** |
|
|
|
* @ORM\OneToMany(targetEntity="Lc\ShopBundle\Context\PageInterface", mappedBy="merchant", orphanRemoval=true) |
|
|
|
*/ |
|
|
|
protected $pages; |
|
|
|
|
|
|
|
/** |
|
|
|
* @ORM\OneToMany(targetEntity="Lc\ShopBundle\Context\NewsletterInterface", mappedBy="merchant") |
|
|
|
*/ |
|
|
@@ -279,6 +284,37 @@ abstract class Merchant extends AbstractDocumentEntity |
|
|
|
return $this; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @return Collection|Page[] |
|
|
|
*/ |
|
|
|
public function getPages(): Collection |
|
|
|
{ |
|
|
|
return $this->pages; |
|
|
|
} |
|
|
|
|
|
|
|
public function addPage(Page $page): self |
|
|
|
{ |
|
|
|
if (!$this->pages->contains($page)) { |
|
|
|
$this->pages[] = $page; |
|
|
|
$page->setMerchant($this); |
|
|
|
} |
|
|
|
|
|
|
|
return $this; |
|
|
|
} |
|
|
|
|
|
|
|
public function removePage(Page $page): self |
|
|
|
{ |
|
|
|
if ($this->pages->contains($page)) { |
|
|
|
$this->pages->removeElement($page); |
|
|
|
// set the owning side to null (unless already changed) |
|
|
|
if ($page->getMerchant() === $this) { |
|
|
|
$page->setMerchant(null); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return $this; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @return Collection|Newsletter[] |
|
|
|
*/ |