From e1705c2d17dbbf88161a29471e4bba9cecc86f2b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Gertz?= Date: Tue, 17 Aug 2021 01:01:28 +0200 Subject: [PATCH 1/1] Add snipper hat field Update User constructor --- Entity/Snippet.php | 33 +++++++++++++++++++++++++++++++++ Entity/User.php | 6 ++++-- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/Entity/Snippet.php b/Entity/Snippet.php index 99bc040..999091f 100644 --- a/Entity/Snippet.php +++ b/Entity/Snippet.php @@ -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 * diff --git a/Entity/User.php b/Entity/User.php index 151f1a1..22bf46d 100644 --- a/Entity/User.php +++ b/Entity/User.php @@ -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(); -- 2.41.1