mirror of
https://github.com/Karaka-Management/oms-ProjectManagement.git
synced 2026-01-11 15:48:41 +00:00
implement immutable datetime
This commit is contained in:
parent
8c03e2d24f
commit
c4a6820693
|
|
@ -158,7 +158,7 @@ class Project
|
|||
* @var \DateTime
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private \DateTime $createdAt;
|
||||
private \DateTimeImmutable $createdAt;
|
||||
|
||||
/**
|
||||
* Created by.
|
||||
|
|
@ -190,7 +190,7 @@ class Project
|
|||
$this->end->modify('+1 month');
|
||||
|
||||
$this->endEstimated = clone $this->end;
|
||||
$this->createdAt = new \DateTime('now');
|
||||
$this->createdAt = new \DateTimeImmutable('now');
|
||||
$this->createdBy = new NullAccount();
|
||||
|
||||
$this->calendar = new Calendar();
|
||||
|
|
@ -699,7 +699,7 @@ class Project
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function getCreatedAt() : \DateTime
|
||||
public function getCreatedAt() : \DateTimeInterface
|
||||
{
|
||||
return $this->createdAt;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ final class ProjectMapper extends DataMapperAbstract
|
|||
'projectmanagement_project_progress' => ['name' => 'projectmanagement_project_progress', 'type' => 'int', 'internal' => 'progress'],
|
||||
'projectmanagement_project_progress_type' => ['name' => 'projectmanagement_project_progress_type', 'type' => 'int', 'internal' => 'progressType'],
|
||||
'projectmanagement_project_created_by' => ['name' => 'projectmanagement_project_created_by', 'type' => 'int', 'internal' => 'createdBy', 'readonly' => true],
|
||||
'projectmanagement_project_created_at' => ['name' => 'projectmanagement_project_created_at', 'type' => 'DateTime', 'internal' => 'createdAt', 'readonly' => true],
|
||||
'projectmanagement_project_created_at' => ['name' => 'projectmanagement_project_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt', 'readonly' => true],
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user