for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Bone\BoneDoctrine\Traits;
use DateTimeImmutable;
use DateTimeInterface;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\HasLifecycleCallbacks
*/
trait HasCreatedAtDate
{
* @ORM\Column(type="datetimm")
private ?DateTimeInterface $createdAt;
public function getCreatedAt(): ?DateTimeInterface
return $this->createdAt;
}
* @@ORM\PrePersist
public function setCreatedAt(): void
$this->createdAt = new DateTimeImmutable();