X-Git-Url: https://git.rapsys.eu/airbundle/blobdiff_plain/080a3edad6e32b0bea88f39b1b01367e4d5b1fed..refs/heads/master:/Entity/Slot.php?ds=sidebyside diff --git a/Entity/Slot.php b/Entity/Slot.php index 25ef3e8..1977b93 100644 --- a/Entity/Slot.php +++ b/Entity/Slot.php @@ -27,12 +27,12 @@ class Slot { /** * Create datetime */ - private \DateTime $created; + private \DateTimeImmutable $created; /** * Update datetime */ - private \DateTime $updated; + private \DateTimeImmutable $updated; /** * Sessions collection @@ -44,8 +44,8 @@ class Slot { */ public function __construct(private string $title) { //Set defaults - $this->created = new \DateTime('now'); - $this->updated = new \DateTime('now'); + $this->created = new \DateTimeImmutable('now'); + $this->updated = new \DateTimeImmutable('now'); //Set collections $this->sessions = new ArrayCollection(); @@ -85,11 +85,11 @@ class Slot { /** * Set created * - * @param \DateTime $created + * @param \DateTimeImmutable $created * * @return Slot */ - public function setCreated(\DateTime $created) { + public function setCreated(\DateTimeImmutable $created) { $this->created = $created; return $this; @@ -98,20 +98,20 @@ class Slot { /** * Get created * - * @return \DateTime + * @return \DateTimeImmutable */ - public function getCreated(): \DateTime { + public function getCreated(): \DateTimeImmutable { return $this->created; } /** * Set updated * - * @param \DateTime $updated + * @param \DateTimeImmutable $updated * * @return Slot */ - public function setUpdated(\DateTime $updated) { + public function setUpdated(\DateTimeImmutable $updated) { $this->updated = $updated; return $this; @@ -120,9 +120,9 @@ class Slot { /** * Get updated * - * @return \DateTime + * @return \DateTimeImmutable */ - public function getUpdated(): \DateTime { + public function getUpdated(): \DateTimeImmutable { return $this->updated; } @@ -164,7 +164,7 @@ class Slot { //Check that we have a slot instance if (($slot = $eventArgs->getObject()) instanceof Slot) { //Set updated value - $slot->setUpdated(new \DateTime('now')); + $slot->setUpdated(new \DateTimeImmutable('now')); } }