refactor: split in functions

This commit is contained in:
Maël Gangloff
2024-12-20 22:25:41 +01:00
parent e8755af578
commit 5d83386f1a
2 changed files with 286 additions and 230 deletions

View File

@@ -292,12 +292,14 @@ class Domain
#[ORM\PrePersist]
#[ORM\PreUpdate]
public function updateTimestamps(): void
public function updateTimestamps(): static
{
$this->setUpdatedAt(new \DateTimeImmutable('now'));
if (null === $this->getCreatedAt()) {
$this->setCreatedAt($this->getUpdatedAt());
}
return $this;
}
private function setUpdatedAt(?\DateTimeImmutable $updatedAt): void