mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-05-23 18:08:39 +00:00
Optimize order
This commit is contained in:
parent
d48d65fe86
commit
16a0b79cc2
|
|
@ -238,7 +238,7 @@ class Account implements ArrayableInterface, \JsonSerializable
|
||||||
/**
|
/**
|
||||||
* Add permission.
|
* Add permission.
|
||||||
*
|
*
|
||||||
* @param PermissionAbstract $permissions
|
* @param PermissionAbstract $permission
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*
|
*
|
||||||
|
|
@ -307,6 +307,20 @@ class Account implements ArrayableInterface, \JsonSerializable
|
||||||
return $this->name1;
|
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.
|
* Get name2.
|
||||||
*
|
*
|
||||||
|
|
@ -319,6 +333,20 @@ class Account implements ArrayableInterface, \JsonSerializable
|
||||||
return $this->name2;
|
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.
|
* Get name3.
|
||||||
*
|
*
|
||||||
|
|
@ -331,6 +359,20 @@ class Account implements ArrayableInterface, \JsonSerializable
|
||||||
return $this->name3;
|
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.
|
* Get email.
|
||||||
*
|
*
|
||||||
|
|
@ -343,6 +385,24 @@ class Account implements ArrayableInterface, \JsonSerializable
|
||||||
return $this->email;
|
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.
|
* Get status.
|
||||||
*
|
*
|
||||||
|
|
@ -357,6 +417,24 @@ class Account implements ArrayableInterface, \JsonSerializable
|
||||||
return $this->status;
|
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.
|
* Get type.
|
||||||
*
|
*
|
||||||
|
|
@ -371,6 +449,24 @@ class Account implements ArrayableInterface, \JsonSerializable
|
||||||
return $this->type;
|
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.
|
* Get last activity.
|
||||||
*
|
*
|
||||||
|
|
@ -423,102 +519,6 @@ class Account implements ArrayableInterface, \JsonSerializable
|
||||||
$this->login = $name;
|
$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.
|
* Update last activity.
|
||||||
*
|
*
|
||||||
|
|
@ -531,6 +531,18 @@ class Account implements ArrayableInterface, \JsonSerializable
|
||||||
$this->lastActive = new \DateTime('NOW');
|
$this->lastActive = new \DateTime('NOW');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get string representation.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public function __toString()
|
||||||
|
{
|
||||||
|
return json_encode($this->toArray());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@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.
|
* Json serialize.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user