diff --git a/Models/Client.php b/Models/Client.php index c0568a3..23b5ed9 100644 --- a/Models/Client.php +++ b/Models/Client.php @@ -41,7 +41,7 @@ class Client private string $info = ''; - private \DateTime $createdAt; + private \DateTimeImmutable $createdAt; private Profile $profile; @@ -68,7 +68,7 @@ class Client */ public function __construct() { - $this->createdAt = new \DateTime('now'); + $this->createdAt = new \DateTimeImmutable('now'); $this->profile = new Profile(); } @@ -303,7 +303,7 @@ class Client * * @since 1.0.0 */ - public function getCreatedAt() : \DateTime + public function getCreatedAt() : \DateTimeInterface { return $this->createdAt; } diff --git a/Models/ClientMapper.php b/Models/ClientMapper.php index 2ae971e..e3824ce 100644 --- a/Models/ClientMapper.php +++ b/Models/ClientMapper.php @@ -42,7 +42,7 @@ final class ClientMapper extends DataMapperAbstract 'clientmgmt_client_status' => ['name' => 'clientmgmt_client_status', 'type' => 'int', 'internal' => 'status'], 'clientmgmt_client_type' => ['name' => 'clientmgmt_client_type', 'type' => 'int', 'internal' => 'type'], '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'], ];