/**
* 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'));
}
}
}
/**
* Create datetime
*/
- private \DateTime $created;
+ private \DateTimeImmutable $created;
/**
* Update datetime
*/
- private \DateTime $updated;
+ private \DateTimeImmutable $updated;
/**
* Users collection
*/
public function __construct(private string $code, private string $alpha, 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->users = new ArrayCollection();
/**
* Set created
*
- * @param \DateTime $created
+ * @param \DateTimeImmutable $created
*
* @return Country
*/
- public function setCreated(\DateTime $created): Country {
+ public function setCreated(\DateTimeImmutable $created): Country {
$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 Country
*/
- public function setUpdated(\DateTime $updated): Country {
+ public function setUpdated(\DateTimeImmutable $updated): Country {
$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 country instance
if (($country = $eventArgs->getObject()) instanceof Country) {
//Set updated value
- $country->setUpdated(new \DateTime('now'));
+ $country->setUpdated(new \DateTimeImmutable('now'));
}
}
/**
* Create datetime
*/
- private \DateTime $created;
+ private \DateTimeImmutable $created;
/**
* Update datetime
*/
- private \DateTime $updated;
+ private \DateTimeImmutable $updated;
/**
* Applications collection
*/
public function __construct(private string $name, private string $type) {
//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->applications = new ArrayCollection();
/**
* Set created
*
- * @param \DateTime $created
+ * @param \DateTimeImmutable $created
*
* @return Dance
*/
- public function setCreated(\DateTime $created): Dance {
+ public function setCreated(\DateTimeImmutable $created): Dance {
$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 Dance
*/
- public function setUpdated(\DateTime $updated): Dance {
+ public function setUpdated(\DateTimeImmutable $updated): Dance {
$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 a dance instance
if (($dance = $eventArgs->getObject()) instanceof Dance) {
//Set updated value
- $dance->setUpdated(new \DateTime('now'));
+ $dance->setUpdated(new \DateTimeImmutable('now'));
}
}
/**
* Create datetime
*/
- private \DateTime $created;
+ private \DateTimeImmutable $created;
/**
* Update datetime
*/
- private \DateTime $updated;
+ private \DateTimeImmutable $updated;
/**
* Constructor
* @param GoogleToken $googleToken The google token
* @param string $mail The google calendar id
* @param string $summary The google calendar summary
- * @param \DateTime $synchronized The google calendar last synchronization
+ * @param \DateTimeImmutable $synchronized The google calendar last synchronization
*/
- public function __construct(private GoogleToken $googleToken, private string $mail, private string $summary, private \DateTime $synchronized = new \DateTime('now')) {
+ public function __construct(private GoogleToken $googleToken, private string $mail, private string $summary, private \DateTimeImmutable $synchronized = new \DateTime('now')) {
//Set defaults
- $this->created = new \DateTime('now');
- $this->updated = new \DateTime('now');
+ $this->created = new \DateTimeImmutable('now');
+ $this->updated = new \DateTimeImmutable('now');
}
/**
/**
* Set synchronized
*
- * @param \DateTime $synchronized
+ * @param \DateTimeImmutable $synchronized
*
* @return GoogleCalendar
*/
- public function setSynchronized(\DateTime $synchronized): GoogleCalendar {
+ public function setSynchronized(\DateTimeImmutable $synchronized): GoogleCalendar {
$this->synchronized = $synchronized;
return $this;
/**
* Get synchronized
*
- * @return \DateTime
+ * @return \DateTimeImmutable
*/
- public function getSynchronized(): \DateTime {
+ public function getSynchronized(): \DateTimeImmutable {
return $this->synchronized;
}
/**
* Set created
*
- * @param \DateTime $created
+ * @param \DateTimeImmutable $created
*
* @return GoogleCalendar
*/
- public function setCreated(\DateTime $created): GoogleCalendar {
+ public function setCreated(\DateTimeImmutable $created): GoogleCalendar {
$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 GoogleCalendar
*/
- public function setUpdated(\DateTime $updated): GoogleCalendar {
+ public function setUpdated(\DateTimeImmutable $updated): GoogleCalendar {
$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 snippet instance
if (($entity = $eventArgs->getObject()) instanceof GoogleCalendar) {
//Set updated value
- return $entity->setUpdated(new \DateTime('now'));
+ return $entity->setUpdated(new \DateTimeImmutable('now'));
}
}
}
/**
* Create datetime
*/
- private \DateTime $created;
+ private \DateTimeImmutable $created;
/**
* Update datetime
*/
- private \DateTime $updated;
+ private \DateTimeImmutable $updated;
/**
* Google calendars collection
* @param User $user The user instance
* @param string The token user mail
* @param string The access token identifier
- * @param \DateTime The access token expires
+ * @param \DateTimeImmutable The access token expires
* @param ?string The refresh token identifier
*/
- public function __construct(private User $user, private string $mail, private string $access, private \DateTime $expired, private ?string $refresh = null) {
+ public function __construct(private User $user, private string $mail, private string $access, private \DateTimeImmutable $expired, private ?string $refresh = null) {
//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->googleCalendars = new ArrayCollection();
/**
* Set expired
*
- * @param \DateTime $expired
+ * @param \DateTimeImmutable $expired
*
* @return GoogleToken
*/
- public function setExpired(\DateTime $expired): GoogleToken {
+ public function setExpired(\DateTimeImmutable $expired): GoogleToken {
$this->expired = $expired;
return $this;
/**
* Get expired
*
- * @return \DateTime
+ * @return \DateTimeImmutable
*/
- public function getExpired(): \DateTime {
+ public function getExpired(): \DateTimeImmutable {
return $this->expired;
}
/**
* Set created
*
- * @param \DateTime $created
+ * @param \DateTimeImmutable $created
*
* @return GoogleToken
*/
- public function setCreated(\DateTime $created): GoogleToken {
+ public function setCreated(\DateTimeImmutable $created): GoogleToken {
$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 GoogleToken
*/
- public function setUpdated(\DateTime $updated): GoogleToken {
+ public function setUpdated(\DateTimeImmutable $updated): GoogleToken {
$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 snippet instance
if (($entity = $eventArgs->getObject()) instanceof GoogleToken) {
//Set updated value
- return $entity->setUpdated(new \DateTime('now'));
+ return $entity->setUpdated(new \DateTimeImmutable('now'));
}
}
}
/**
* Create datetime
*/
- private \DateTime $created;
+ private \DateTimeImmutable $created;
/**
* Update datetime
*/
- private \DateTime $updated;
+ private \DateTimeImmutable $updated;
/**
* Sessions collection
*/
public function __construct(private string $title = '', private string $address = '', private string $zipcode = '0', private string $city = '', private string $latitude = '0', private string $longitude = '0', private bool $hotspot = false, private bool $indoor = false) {
//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();
/**
* Set created
*
- * @param \DateTime $created
+ * @param \DateTimeImmutable $created
*
* @return Location
*/
- public function setCreated(\DateTime $created): Location {
+ public function setCreated(\DateTimeImmutable $created): Location {
$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 Location
*/
- public function setUpdated(\DateTime $updated): Location {
+ public function setUpdated(\DateTimeImmutable $updated): Location {
$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 a location instance
if (($location = $eventArgs->getObject()) instanceof Location) {
//Set updated value
- $location->setUpdated(new \DateTime('now'));
+ $location->setUpdated(new \DateTimeImmutable('now'));
}
}
/**
* Begin time
*/
- private ?\DateTime $begin = null;
+ private ?\DateTimeImmutable $begin = null;
/**
* Computed start datetime
*/
- private ?\DateTime $start = null;
+ private ?\DateTimeImmutable $start = null;
/**
* Length time
*/
- private ?\DateTime $length = null;
+ private ?\DateTimeImmutable $length = null;
/**
* Computed stop datetime
*/
- private ?\DateTime $stop = null;
+ private ?\DateTimeImmutable $stop = null;
/**
* Premium
/**
* Lock datetime
*/
- private ?\DateTime $locked = null;
+ private ?\DateTimeImmutable $locked = null;
/**
* Create datetime
*/
- private \DateTime $created;
+ private \DateTimeImmutable $created;
/**
* Update datetime
*/
- private \DateTime $updated;
+ private \DateTimeImmutable $updated;
/**
* Application instance
/**
* Constructor
*/
- public function __construct(private \DateTime $date, private Location $location, private Slot $slot) {
+ public function __construct(private \DateTimeImmutable $date, private Location $location, private Slot $slot) {
//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->applications = new ArrayCollection();
/**
* Set date
*
- * @param \DateTime $date
+ * @param \DateTimeImmutable $date
*
* @return Session
*/
- public function setDate(\DateTime $date): Session {
+ public function setDate(\DateTimeImmutable $date): Session {
$this->date = $date;
return $this;
/**
* Get date
*
- * @return \DateTime
+ * @return \DateTimeImmutable
*/
- public function getDate(): \DateTime {
+ public function getDate(): \DateTimeImmutable {
return $this->date;
}
/**
* Set begin
*
- * @param \DateTime $begin
+ * @param \DateTimeImmutable $begin
*
* @return Session
*/
- public function setBegin(?\DateTime $begin): Session {
+ public function setBegin(?\DateTimeImmutable $begin): Session {
$this->begin = $begin;
return $this;
/**
* Get begin
*
- * @return \DateTime
+ * @return \DateTimeImmutable
*/
- public function getBegin(): ?\DateTime {
+ public function getBegin(): ?\DateTimeImmutable {
return $this->begin;
}
/**
* Get start
*
- * @return \DateTime
+ * @return \DateTimeImmutable
*/
- public function getStart(): \DateTime {
+ public function getStart(): \DateTimeImmutable {
//With start
if ($this->start !== null) {
return $this->start;
/**
* Set length
*
- * @param \DateTime $length
+ * @param \DateTimeImmutable $length
*
* @return Session
*/
- public function setLength(?\DateTime $length): Session {
+ public function setLength(?\DateTimeImmutable $length): Session {
$this->length = $length;
return $this;
/**
* Get length
*
- * @return \DateTime
+ * @return \DateTimeImmutable
*/
- public function getLength(): ?\DateTime {
+ public function getLength(): ?\DateTimeImmutable {
return $this->length;
}
/**
* Get stop
*
- * @return \DateTime
+ * @return \DateTimeImmutable
*/
- public function getStop(): \DateTime {
+ public function getStop(): \DateTimeImmutable {
//Check start
if ($this->stop !== null) {
return $this->stop;
/**
* Set locked
*
- * @param \DateTime $locked
+ * @param \DateTimeImmutable $locked
*
* @return Session
*/
- public function setLocked(?\DateTime $locked): Session {
+ public function setLocked(?\DateTimeImmutable $locked): Session {
$this->locked = $locked;
return $this;
/**
* Get locked
*
- * @return \DateTime
+ * @return \DateTimeImmutable
*/
- public function getLocked(): ?\DateTime {
+ public function getLocked(): ?\DateTimeImmutable {
return $this->locked;
}
/**
* Set created
*
- * @param \DateTime $created
+ * @param \DateTimeImmutable $created
*
* @return Session
*/
- public function setCreated(\DateTime $created): Session {
+ public function setCreated(\DateTimeImmutable $created): Session {
$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 Session
*/
- public function setUpdated(\DateTime $updated): Session {
+ public function setUpdated(\DateTimeImmutable $updated): Session {
$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 a session instance
if (($session = $eventArgs->getObject()) instanceof Session) {
//Set updated value
- $session->setUpdated(new \DateTime('now'));
+ $session->setUpdated(new \DateTimeImmutable('now'));
}
}
/**
* Create datetime
*/
- private \DateTime $created;
+ private \DateTimeImmutable $created;
/**
* Update datetime
*/
- private \DateTime $updated;
+ private \DateTimeImmutable $updated;
/**
* Sessions collection
*/
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();
/**
* 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;
/**
* 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;
/**
* Get updated
*
- * @return \DateTime
+ * @return \DateTimeImmutable
*/
- public function getUpdated(): \DateTime {
+ public function getUpdated(): \DateTimeImmutable {
return $this->updated;
}
//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'));
}
}
/**
* Create datetime
*/
- private \DateTime $created;
+ private \DateTimeImmutable $created;
/**
* Update datetime
*/
- private \DateTime $updated;
+ private \DateTimeImmutable $updated;
/**
* Constructor
*/
public function __construct(private string $locale, private Location $location, private User $user) {
//Set defaults
- $this->created = new \DateTime('now');
- $this->updated = new \DateTime('now');
+ $this->created = new \DateTimeImmutable('now');
+ $this->updated = new \DateTimeImmutable('now');
}
/**
/**
* Set created
*
- * @param \DateTime $created
+ * @param \DateTimeImmutable $created
*
* @return Snippet
*/
- public function setCreated(\DateTime $created): Snippet {
+ public function setCreated(\DateTimeImmutable $created): Snippet {
$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 Snippet
*/
- public function setUpdated(\DateTime $updated): Snippet {
+ public function setUpdated(\DateTimeImmutable $updated): Snippet {
$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 snippet instance
if (($snippet = $eventArgs->getObject()) instanceof Snippet) {
//Set updated value
- $snippet->setUpdated(new \DateTime('now'));
+ $snippet->setUpdated(new \DateTimeImmutable('now'));
}
}
}