Optimize order

This commit is contained in:
Dennis Eichhorn 2017-09-18 18:36:40 +02:00
parent d48d65fe86
commit 16a0b79cc2

View File

@ -238,7 +238,7 @@ class Account implements ArrayableInterface, \JsonSerializable
/**
* Add permission.
*
* @param PermissionAbstract $permissions
* @param PermissionAbstract $permission
*
* @return void
*
@ -307,6 +307,20 @@ class Account implements ArrayableInterface, \JsonSerializable
return $this->name1;
}
/**
* Set name1.
*
* @param string $name Name
*
* @return void
*
* @since 1.0.0
*/
public function setName1(string $name) /* : void */
{
$this->name1 = $name;
}
/**
* Get name2.
*
@ -319,6 +333,20 @@ class Account implements ArrayableInterface, \JsonSerializable
return $this->name2;
}
/**
* Set name2.
*
* @param string $name Name
*
* @return void
*
* @since 1.0.0
*/
public function setName2(string $name) /* : void */
{
$this->name2 = $name;
}
/**
* Get name3.
*
@ -331,6 +359,20 @@ class Account implements ArrayableInterface, \JsonSerializable
return $this->name3;
}
/**
* Set name3.
*
* @param string $name Name
*
* @return void
*
* @since 1.0.0
*/
public function setName3(string $name) /* : void */
{
$this->name3 = $name;
}
/**
* Get email.
*
@ -343,6 +385,24 @@ class Account implements ArrayableInterface, \JsonSerializable
return $this->email;
}
/**
* Set email.
*
* @param string $email Email
*
* @return void
*
* @since 1.0.0
*/
public function setEmail(string $email) /* : void */
{
if (!Email::isValid($email)) {
throw new \InvalidArgumentException();
}
$this->email = mb_strtolower($email);
}
/**
* Get status.
*
@ -357,6 +417,24 @@ class Account implements ArrayableInterface, \JsonSerializable
return $this->status;
}
/**
* Get status.
*
* @param int $status Status
*
* @return void
*
* @since 1.0.0
*/
public function setStatus(int $status) /* : void */
{
if (!AccountStatus::isValidValue($status)) {
throw new \InvalidArgumentException();
}
$this->status = $status;
}
/**
* Get type.
*
@ -371,6 +449,24 @@ class Account implements ArrayableInterface, \JsonSerializable
return $this->type;
}
/**
* Get type.
*
* @param int $type Type
*
* @return void
*
* @since 1.0.0
*/
public function setType(int $type) /* : void */
{
if (!AccountType::isValidValue($type)) {
throw new \InvalidArgumentException();
}
$this->type = $type;
}
/**
* Get last activity.
*
@ -423,102 +519,6 @@ class Account implements ArrayableInterface, \JsonSerializable
$this->login = $name;
}
/**
* Set name1.
*
* @param string $name Name
*
* @return void
*
* @since 1.0.0
*/
public function setName1(string $name) /* : void */
{
$this->name1 = $name;
}
/**
* Set name2.
*
* @param string $name Name
*
* @return void
*
* @since 1.0.0
*/
public function setName2(string $name) /* : void */
{
$this->name2 = $name;
}
/**
* Set name3.
*
* @param string $name Name
*
* @return void
*
* @since 1.0.0
*/
public function setName3(string $name) /* : void */
{
$this->name3 = $name;
}
/**
* Set email.
*
* @param string $email Email
*
* @return void
*
* @since 1.0.0
*/
public function setEmail(string $email) /* : void */
{
if (!Email::isValid($email)) {
throw new \InvalidArgumentException();
}
$this->email = mb_strtolower($email);
}
/**
* Get status.
*
* @param int $status Status
*
* @return void
*
* @since 1.0.0
*/
public function setStatus(int $status) /* : void */
{
if (!AccountStatus::isValidValue($status)) {
throw new \InvalidArgumentException();
}
$this->status = $status;
}
/**
* Get type.
*
* @param int $type Type
*
* @return void
*
* @since 1.0.0
*/
public function setType(int $type) /* : void */
{
if (!AccountType::isValidValue($type)) {
throw new \InvalidArgumentException();
}
$this->type = $type;
}
/**
* Update last activity.
*
@ -531,6 +531,18 @@ class Account implements ArrayableInterface, \JsonSerializable
$this->lastActive = new \DateTime('NOW');
}
/**
* Get string representation.
*
* @return string
*
* @since 1.0.0
*/
public function __toString()
{
return json_encode($this->toArray());
}
/**
* {@inheritdoc}
*/
@ -552,18 +564,6 @@ class Account implements ArrayableInterface, \JsonSerializable
];
}
/**
* Get string representation.
*
* @return string
*
* @since 1.0.0
*/
public function __toString()
{
return json_encode($this->toArray());
}
/**
* Json serialize.
*