/**
* Cancel datetime
*/
- private ?\DateTime $canceled = null;
+ private ?\DateTimeImmutable $canceled = null;
/**
* Create datetime
*/
- private \DateTime $created;
+ private \DateTimeImmutable $created;
/**
* Update datetime
*/
- private \DateTime $updated;
+ private \DateTimeImmutable $updated;
/**
* Session instance
*/
public function __construct() {
//Set defaults
- $this->created = new \DateTime('now');
- $this->updated = new \DateTime('now');
+ $this->created = new \DateTimeImmutable('now');
+ $this->updated = new \DateTimeImmutable('now');
}
/**
/**
* Set canceled
*
- * @param \DateTime $canceled
+ * @param \DateTimeImmutable $canceled
*
* @return Application
*/
- public function setCanceled(?\DateTime $canceled): Application {
+ public function setCanceled(?\DateTimeImmutable $canceled): Application {
$this->canceled = $canceled;
return $this;
/**
* Get canceled
*
- * @return \DateTime
+ * @return \DateTimeImmutable
*/
- public function getCanceled(): ?\DateTime {
+ public function getCanceled(): ?\DateTimeImmutable {
return $this->canceled;
}
/**
* Set created
*
- * @param \DateTime $created
+ * @param \DateTimeImmutable $created
*
* @return Application
*/
- public function setCreated(\DateTime $created): Application {
+ public function setCreated(\DateTimeImmutable $created): Application {
$this->created = $created;
return $this;
/**
* 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 Application
*/
- public function setUpdated(\DateTime $updated): Application {
+ public function setUpdated(\DateTimeImmutable $updated): Application {
$this->updated = $updated;
return $this;
/**
* Get updated
*
- * @return \DateTime
+ * @return \DateTimeImmutable
*/
- public function getUpdated(): \DateTime {
+ public function getUpdated(): \DateTimeImmutable {
return $this->updated;
}
//Check that we have an application instance
if (($application = $eventArgs->getObject()) instanceof Application) {
//Set updated value
- $application->setUpdated(new \DateTime('now'));
+ $application->setUpdated(new \DateTimeImmutable('now'));
}
}
}