diff --git a/Models/Promotion.php b/Models/Promotion.php index f6cf70d..ca0921c 100755 --- a/Models/Promotion.php +++ b/Models/Promotion.php @@ -78,7 +78,7 @@ class Promotion * @var \DateTime * @since 1.0.0 */ - private \DateTime $createdAt; + private \DateTimeImmutable $createdAt; /** * Created by. @@ -102,7 +102,7 @@ class Promotion $this->start = new \DateTime('now'); $this->end = new \DateTime('now'); $this->end->modify('+1 month'); - $this->createdAt = new \DateTime('now'); + $this->createdAt = new \DateTimeImmutable('now'); $this->createdBy = new NullAccount(); $this->calendar = new Calendar(); @@ -482,7 +482,7 @@ class Promotion * * @since 1.0.0 */ - public function getCreatedAt() : \DateTime + public function getCreatedAt() : \DateTimeInterface { return $this->createdAt; } diff --git a/Models/PromotionMapper.php b/Models/PromotionMapper.php index c9f1b8c..4107a78 100755 --- a/Models/PromotionMapper.php +++ b/Models/PromotionMapper.php @@ -49,7 +49,7 @@ final class PromotionMapper extends DataMapperAbstract 'marketing_promotion_progress' => ['name' => 'marketing_promotion_progress', 'type' => 'int', 'internal' => 'progress'], 'marketing_promotion_progress_type' => ['name' => 'marketing_promotion_progress_type', 'type' => 'int', 'internal' => 'progressType'], 'marketing_promotion_created_by' => ['name' => 'marketing_promotion_created_by', 'type' => 'int', 'internal' => 'createdBy', 'readonly' => true], - 'marketing_promotion_created_at' => ['name' => 'marketing_promotion_created_at', 'type' => 'DateTime', 'internal' => 'createdAt', 'readonly' => true], + 'marketing_promotion_created_at' => ['name' => 'marketing_promotion_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt', 'readonly' => true], ]; /**