use ChamberOrchestra\DoctrineClockBundle\Entity\TimestampTrait;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity]
class Article
{
use TimestampTrait; // adds createdDatetime + updatedDatetime
// ... your fields
}
use ChamberOrchestra\DoctrineClockBundle\Mapping\Attribute\CreateTimestamp;
use ChamberOrchestra\DoctrineClockBundle\Mapping\Attribute\UpdateTimestamp;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Clock\DatePoint;
#[ORM\Entity]
class Article
{
#[CreateTimestamp]
#[ORM\Column(type: 'date_point', nullable: false)]
private DatePoint $createdAt;
#[UpdateTimestamp]
#[ORM\Column(type: 'date_point', nullable: false)]
private DatePoint $modifiedAt;
// ... getters, setters
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.