]> Raphaƫl G. Git Repositories - airbundle/blobdiff - Entity/User.php
Add snipper hat field
[airbundle] / Entity / User.php
index 530ea4da0cf7371d4c2e7f38cb9134ce767b7dd4..22bf46da496d7298ff95163b1258a6e10567bdd4 100644 (file)
@@ -23,30 +23,38 @@ class User extends BaseUser {
        /**
         * @var \Doctrine\Common\Collections\Collection
         */
-       private $subscribers;
+       private $locations;
 
        /**
         * @var \Doctrine\Common\Collections\Collection
         */
-       private $subscriptions;
+       private $snippets;
 
        /**
         * @var \Doctrine\Common\Collections\Collection
         */
-       private $snippets;
+       private $subscribers;
+
+       /**
+        * @var \Doctrine\Common\Collections\Collection
+        */
+       private $subscriptions;
 
        /**
         * Constructor
+        *
+        * @param string $mail The user mail
         */
-       public function __construct() {
+       public function __construct(string $mail) {
                //Call parent constructor
-               parent::__construct();
+               parent::__construct($mail);
 
                //Set collections
                $this->applications = new \Doctrine\Common\Collections\ArrayCollection();
+               $this->locations = new \Doctrine\Common\Collections\ArrayCollection();
+               $this->snippets = new \Doctrine\Common\Collections\ArrayCollection();
                $this->subscribers = new \Doctrine\Common\Collections\ArrayCollection();
                $this->subscriptions = new \Doctrine\Common\Collections\ArrayCollection();
-               $this->snippets = new \Doctrine\Common\Collections\ArrayCollection();
        }
 
        /**
@@ -146,6 +154,68 @@ class User extends BaseUser {
                return $this->applications;
        }
 
+       /**
+        * Add snippet
+        *
+        * @param \Rapsys\AirBundle\Entity\Snippet $snippet
+        *
+        * @return User
+        */
+       public function addSnippet(Snippet $snippet) {
+               $this->snippets[] = $snippet;
+
+               return $this;
+       }
+
+       /**
+        * Remove snippet
+        *
+        * @param \Rapsys\AirBundle\Entity\Snippet $snippet
+        */
+       public function removeSnippet(Snippet $snippet) {
+               $this->snippets->removeElement($snippet);
+       }
+
+       /**
+        * Get snippets
+        *
+        * @return \Doctrine\Common\Collections\Collection
+        */
+       public function getSnippets() {
+               return $this->snippets;
+       }
+
+       /**
+        * Add location
+        *
+        * @param \Rapsys\AirBundle\Entity\Location $location
+        *
+        * @return User
+        */
+       public function addLocation(Location $location) {
+               $this->locations[] = $location;
+
+               return $this;
+       }
+
+       /**
+        * Remove location
+        *
+        * @param \Rapsys\AirBundle\Entity\Location $location
+        */
+       public function removeLocation(Location $location) {
+               $this->locations->removeElement($location);
+       }
+
+       /**
+        * Get locations
+        *
+        * @return \Doctrine\Common\Collections\Collection
+        */
+       public function getLocations() {
+               return $this->locations;
+       }
+
        /**
         * Add subscriber
         *
@@ -207,35 +277,4 @@ class User extends BaseUser {
        public function getSubscriptions() {
                return $this->subscriptions;
        }
-
-       /**
-        * Add snippet
-        *
-        * @param \Rapsys\AirBundle\Entity\Snippet $snippet
-        *
-        * @return User
-        */
-       public function addSnippet(Snippet $snippet) {
-               $this->snippets[] = $snippet;
-
-               return $this;
-       }
-
-       /**
-        * Remove snippet
-        *
-        * @param \Rapsys\AirBundle\Entity\Snippet $snippet
-        */
-       public function removeSnippet(Snippet $snippet) {
-               $this->snippets->removeElement($snippet);
-       }
-
-       /**
-        * Get snippets
-        *
-        * @return \Doctrine\Common\Collections\Collection
-        */
-       public function getSnippets() {
-               return $this->snippets;
-       }
 }