mirror of
https://github.com/Karaka-Management/oms-ClientManagement.git
synced 2026-02-11 22:38:42 +00:00
implement immutable datetime
This commit is contained in:
parent
d3b0d0fdf0
commit
b412f12149
|
|
@ -41,7 +41,7 @@ class Client
|
||||||
|
|
||||||
private string $info = '';
|
private string $info = '';
|
||||||
|
|
||||||
private \DateTime $createdAt;
|
private \DateTimeImmutable $createdAt;
|
||||||
|
|
||||||
private Profile $profile;
|
private Profile $profile;
|
||||||
|
|
||||||
|
|
@ -68,7 +68,7 @@ class Client
|
||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->createdAt = new \DateTime('now');
|
$this->createdAt = new \DateTimeImmutable('now');
|
||||||
$this->profile = new Profile();
|
$this->profile = new Profile();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -303,7 +303,7 @@ class Client
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public function getCreatedAt() : \DateTime
|
public function getCreatedAt() : \DateTimeInterface
|
||||||
{
|
{
|
||||||
return $this->createdAt;
|
return $this->createdAt;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ final class ClientMapper extends DataMapperAbstract
|
||||||
'clientmgmt_client_status' => ['name' => 'clientmgmt_client_status', 'type' => 'int', 'internal' => 'status'],
|
'clientmgmt_client_status' => ['name' => 'clientmgmt_client_status', 'type' => 'int', 'internal' => 'status'],
|
||||||
'clientmgmt_client_type' => ['name' => 'clientmgmt_client_type', 'type' => 'int', 'internal' => 'type'],
|
'clientmgmt_client_type' => ['name' => 'clientmgmt_client_type', 'type' => 'int', 'internal' => 'type'],
|
||||||
'clientmgmt_client_info' => ['name' => 'clientmgmt_client_info', 'type' => 'string', 'internal' => 'info'],
|
'clientmgmt_client_info' => ['name' => 'clientmgmt_client_info', 'type' => 'string', 'internal' => 'info'],
|
||||||
'clientmgmt_client_created_at' => ['name' => 'clientmgmt_client_created_at', 'type' => 'DateTime', 'internal' => 'createdAt', 'readonly' => true],
|
'clientmgmt_client_created_at' => ['name' => 'clientmgmt_client_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt', 'readonly' => true],
|
||||||
'clientmgmt_client_profile' => ['name' => 'clientmgmt_client_profile', 'type' => 'int', 'internal' => 'profile'],
|
'clientmgmt_client_profile' => ['name' => 'clientmgmt_client_profile', 'type' => 'int', 'internal' => 'profile'],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user