X-Git-Url: https://git.rapsys.eu/airbundle/blobdiff_plain/c2c98c325c080c171b752a605ce8cf7dd9f2ed26..1b23290b9c48b7db35dd1849960f549e1177dc1b:/Entity/Snippet.php diff --git a/Entity/Snippet.php b/Entity/Snippet.php index 28c7c1c..ee5b262 100644 --- a/Entity/Snippet.php +++ b/Entity/Snippet.php @@ -96,6 +96,7 @@ class Snippet { * Constructor */ public function __construct() { + //Set defaults $this->description = null; $this->class = null; $this->short = null; @@ -105,6 +106,9 @@ class Snippet { $this->donate = null; $this->link = null; $this->profile = null; + $this->created = new \DateTime('now'); + $this->updated = new \DateTime('now'); + $this->location = null; } /** @@ -207,11 +211,11 @@ class Snippet { /** * Set rate * - * @param string $rate + * @param int $rate * * @return Snippet */ - public function setRate(?string $rate): Snippet { + public function setRate(?int $rate): Snippet { $this->rate = $rate; return $this; @@ -220,9 +224,9 @@ class Snippet { /** * Get rate * - * @return string + * @return int */ - public function getRate(): ?string { + public function getRate(): ?int { return $this->rate; } @@ -233,7 +237,7 @@ class Snippet { * * @return User */ - public function setHat(bool $hat): Snippet { + public function setHat(?bool $hat): Snippet { $this->hat = $hat; return $this; @@ -244,7 +248,7 @@ class Snippet { * * @return bool */ - public function getHat(): bool { + public function getHat(): ?bool { return $this->hat; } /**