]> Raphaël G. Git Repositories - airbundle/commitdiff
Add snipper hat field
authorRaphaël Gertz <git@rapsys.eu>
Mon, 16 Aug 2021 23:01:28 +0000 (01:01 +0200)
committerRaphaël Gertz <git@rapsys.eu>
Mon, 16 Aug 2021 23:01:28 +0000 (01:01 +0200)
Update User constructor

Entity/Snippet.php
Entity/User.php

index 99bc040a170e26b1b28dd45dbc16ab1175da9dae..999091f6733d220b9f92c72cbf83cf405cdde7c2 100644 (file)
@@ -39,6 +39,11 @@ class Snippet {
         */
        protected $rate;
 
+       /**
+        * @var bool
+        */
+       protected $hat;
+
        /**
         * @var string
         */
@@ -79,6 +84,13 @@ class Snippet {
         */
        protected $user;
 
+       /**
+        * Constructor
+        */
+       public function __construct() {
+               $this->hat = true;
+       }
+
        /**
         * Get id
         *
@@ -198,6 +210,27 @@ class Snippet {
                return $this->rate;
        }
 
+       /**
+        * Set hat
+        *
+        * @param bool $hat
+        *
+        * @return User
+        */
+       public function setHat(bool $hat) {
+               $this->hat = $hat;
+
+               return $this;
+       }
+
+       /**
+        * Get hat
+        *
+        * @return bool
+        */
+       public function getHat(): bool {
+               return $this->hat;
+       }
        /**
         * Set contact
         *
index 151f1a10f86662f4c2d9d1724c40bf9a4ad83321..22bf46da496d7298ff95163b1258a6e10567bdd4 100644 (file)
@@ -42,10 +42,12 @@ class User extends BaseUser {
 
        /**
         * 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();