Account extension

This commit is contained in:
Dennis Eichhorn 2016-12-19 19:41:03 +01:00
parent 174d597682
commit 111494c1cc

View File

@ -159,6 +159,7 @@ class Account implements ArrayableInterface, \JsonSerializable
public function __construct(int $id = 0) public function __construct(int $id = 0)
{ {
$this->createdAt = new \DateTime('now'); $this->createdAt = new \DateTime('now');
$this->lastActive = new \DateTime('now');
$this->id = $id; $this->id = $id;
$this->l11n = new NullLocalization(); $this->l11n = new NullLocalization();
} }
@ -204,6 +205,19 @@ class Account implements ArrayableInterface, \JsonSerializable
$this->l11n = $l11n; $this->l11n = $l11n;
} }
/**
* Get name.
*
* @return string
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function getName() : string
{
return $this->login;
}
/** /**
* Get name1. * Get name1.
* *
@ -312,6 +326,21 @@ class Account implements ArrayableInterface, \JsonSerializable
return $this->createdAt ?? new \DateTime('NOW'); return $this->createdAt ?? new \DateTime('NOW');
} }
/**
* Set name.
*
* @param string $name Name
*
* @return void
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function setName(string $name) /* : void */
{
$this->login = $name;
}
/** /**
* Set name1. * Set name1.
* *