diff --git a/Models/EditorDoc.php b/Models/EditorDoc.php index 7d90364..e1aff0b 100755 --- a/Models/EditorDoc.php +++ b/Models/EditorDoc.php @@ -75,7 +75,7 @@ class EditorDoc implements \JsonSerializable, ArrayableInterface * @var \DateTime * @since 1.0.0 */ - private \DateTime $createdAt; + private \DateTimeImmutable $createdAt; /** * Creator. @@ -101,7 +101,7 @@ class EditorDoc implements \JsonSerializable, ArrayableInterface public function __construct() { $this->createdBy = new NullAccount(); - $this->createdAt = new \DateTime('now'); + $this->createdAt = new \DateTimeImmutable('now'); } /** @@ -163,7 +163,7 @@ class EditorDoc implements \JsonSerializable, ArrayableInterface * * @since 1.0.0 */ - public function getCreatedAt() : \DateTime + public function getCreatedAt() : \DateTimeInterface { return $this->createdAt; } diff --git a/Models/EditorDocMapper.php b/Models/EditorDocMapper.php index ecbe5a2..bb2e188 100755 --- a/Models/EditorDocMapper.php +++ b/Models/EditorDocMapper.php @@ -41,7 +41,7 @@ final class EditorDocMapper extends DataMapperAbstract 'editor_doc_plain' => ['name' => 'editor_doc_plain', 'type' => 'string', 'internal' => 'plain'], 'editor_doc_content' => ['name' => 'editor_doc_content', 'type' => 'string', 'internal' => 'content'], 'editor_doc_path' => ['name' => 'editor_doc_path', 'type' => 'string', 'internal' => 'path'], - 'editor_doc_created_at' => ['name' => 'editor_doc_created_at', 'type' => 'DateTime', 'internal' => 'createdAt', 'readonly' => true], + 'editor_doc_created_at' => ['name' => 'editor_doc_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt', 'readonly' => true], ]; /**