updatedAt = new \DateTimeImmutable('now'); } public function getDomain(): ?Domain { return $this->domain; } public function setDomain(?Domain $domain): static { $this->domain = $domain; return $this; } public function getEntity(): ?Entity { return $this->entity; } public function setEntity(?Entity $entity): static { $this->entity = $entity; return $this; } /** * @return DomainRole[] */ public function getRoles(): array { return $this->roles; } public function setRoles(array $roles): static { $this->roles = $roles; return $this; } public function getUpdatedAt(): ?\DateTimeImmutable { return $this->updatedAt; } public function setUpdatedAt(\DateTimeImmutable $updatedAt): static { $this->updatedAt = $updatedAt; return $this; } #[ORM\PrePersist] #[ORM\PreUpdate] public function updateTimestamps(): void { $this->setUpdatedAt(new \DateTimeImmutable('now')); } }