lastModified; } /** * Returns the date/time when the element was created. * Returns null if the element was not yet saved to DB yet. * * @return DateTime|null the creation time of the part */ public function getAddedDate(): ?DateTime { return $this->addedDate; } /** * Helper for updating the timestamp. It is automatically called by doctrine before persisting. * * @ORM\PrePersist * @ORM\PreUpdate */ public function updatedTimestamps(): void { $this->lastModified = new DateTime('now'); if (null === $this->addedDate) { $this->addedDate = new DateTime('now'); } } }