chore: initial import for test contour
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Entity\Behavior;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* Требует у класса-сущности свойство `$updateAt` (mapped column).
|
||||
*
|
||||
* @property \DateTimeInterface|null $updateAt
|
||||
*/
|
||||
trait UpdateTimestampTrait
|
||||
{
|
||||
#[ORM\PrePersist]
|
||||
public function setInitialUpdateAt(): void
|
||||
{
|
||||
if ($this->updateAt === null) {
|
||||
$this->updateAt = new \DateTimeImmutable();
|
||||
}
|
||||
}
|
||||
|
||||
#[ORM\PreUpdate]
|
||||
public function refreshUpdateAt(): void
|
||||
{
|
||||
$this->updateAt = new \DateTimeImmutable();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user