From 9b176789ea25ad0a7b67789caa25d102894f8858 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Gertz?= Date: Mon, 28 Dec 2020 08:33:00 +0100 Subject: [PATCH] Add snippet feature --- Entity/Location.php | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/Entity/Location.php b/Entity/Location.php index 73fc6b9..e57f235 100644 --- a/Entity/Location.php +++ b/Entity/Location.php @@ -66,11 +66,17 @@ class Location { */ private $sessions; + /** + * @var \Doctrine\Common\Collections\Collection + */ + private $snippets; + /** * Constructor */ public function __construct() { $this->sessions = new \Doctrine\Common\Collections\ArrayCollection(); + $this->snippets = new \Doctrine\Common\Collections\ArrayCollection(); } /** @@ -333,6 +339,37 @@ class Location { return $this->sessions; } + /** + * Add snippet + * + * @param \Rapsys\AirBundle\Entity\Snippet $snippet + * + * @return Location + */ + public function addSnippet(\Rapsys\AirBundle\Entity\Snippet $snippet) { + $this->snippets[] = $snippet; + + return $this; + } + + /** + * Remove snippet + * + * @param \Rapsys\AirBundle\Entity\Snippet $snippet + */ + public function removeSnippet(\Rapsys\AirBundle\Entity\Snippet $snippet) { + $this->snippets->removeElement($snippet); + } + + /** + * Get snippets + * + * @return \Doctrine\Common\Collections\Collection + */ + public function getSnippets() { + return $this->snippets; + } + /** * Returns a string representation of the location * -- 2.41.0