From 111494c1cc89fe8609a4c4e615109fb9f5be1258 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Mon, 19 Dec 2016 19:41:03 +0100 Subject: [PATCH] Account extension --- Account/Account.php | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/Account/Account.php b/Account/Account.php index 72b331cb3..4c4690077 100644 --- a/Account/Account.php +++ b/Account/Account.php @@ -159,6 +159,7 @@ class Account implements ArrayableInterface, \JsonSerializable public function __construct(int $id = 0) { $this->createdAt = new \DateTime('now'); + $this->lastActive = new \DateTime('now'); $this->id = $id; $this->l11n = new NullLocalization(); } @@ -204,6 +205,19 @@ class Account implements ArrayableInterface, \JsonSerializable $this->l11n = $l11n; } + /** + * Get name. + * + * @return string + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ + public function getName() : string + { + return $this->login; + } + /** * Get name1. * @@ -312,6 +326,21 @@ class Account implements ArrayableInterface, \JsonSerializable return $this->createdAt ?? new \DateTime('NOW'); } + /** + * Set name. + * + * @param string $name Name + * + * @return void + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ + public function setName(string $name) /* : void */ + { + $this->login = $name; + } + /** * Set name1. *