issues/27: filter DTO, strip id from payloads, lifecycle updateAt

This commit is contained in:
Valery Petrov
2026-05-15 15:35:50 +03:00
committed by Valeriy Petrov
parent da5f7bb242
commit 76044381fd
22 changed files with 153 additions and 129 deletions
@@ -0,0 +1,24 @@
<?php
declare(strict_types=1);
namespace App\Entity\Behavior;
use Doctrine\ORM\Mapping as ORM;
trait UpdateTimestampTrait
{
#[ORM\PrePersist]
public function setInitialUpdateAt(): void
{
if ($this->updateAt === null) {
$this->updateAt = new \DateTime();
}
}
#[ORM\PreUpdate]
public function refreshUpdateAt(): void
{
$this->updateAt = new \DateTime();
}
}