mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-11 06:28:40 +00:00
Rest tests
This commit is contained in:
parent
6718fba177
commit
7bf20b8436
|
|
@ -437,4 +437,27 @@ class Account
|
||||||
$this->createdAt = $created;
|
$this->createdAt = $created;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function toArray() : array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'id' => $this->id,
|
||||||
|
'name' => [
|
||||||
|
$this->name1,
|
||||||
|
$this->name2,
|
||||||
|
$this->name3,
|
||||||
|
],
|
||||||
|
'email' => $this->email,
|
||||||
|
'login' => $this->login,
|
||||||
|
'groups' => $this->groups,
|
||||||
|
'permissions' => $this->permissions,
|
||||||
|
'type' => $this->type,
|
||||||
|
'status' => $this->status,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function __toString()
|
||||||
|
{
|
||||||
|
return json_encode($this->toArray());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -77,6 +77,22 @@ class Group
|
||||||
*/
|
*/
|
||||||
protected $permissions = [];
|
protected $permissions = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created at.
|
||||||
|
*
|
||||||
|
* @var \DateTime
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
protected $createdAt = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by.
|
||||||
|
*
|
||||||
|
* @var int
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
protected $createdBy = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
|
|
@ -85,6 +101,7 @@ class Group
|
||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
|
$this->createdAt = new \DateTime('now');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -152,4 +169,21 @@ class Group
|
||||||
$this->description = $description;
|
$this->description = $description;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function toArray() : array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'id' => $this->id,
|
||||||
|
'name' => $this->name,
|
||||||
|
'description' => $this->description,
|
||||||
|
'createdBy' => $this->createdBy,
|
||||||
|
'createdAt' => $this->createdAt->format('Y-m-d H:i:s'),
|
||||||
|
'permissions' => $this->permissions,
|
||||||
|
'members' => $this->members,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function __toString()
|
||||||
|
{
|
||||||
|
return json_encode($this->toArray());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user