1 | <?php declare(strict_types = 1); |
||
12 | trait TimestampableTrait |
||
13 | { |
||
14 | /** |
||
15 | * @var \DateTime|null |
||
16 | * |
||
17 | * @ORM\Column(name="created_at", type="datetime", nullable=false) |
||
18 | */ |
||
19 | protected $createdAt; |
||
20 | |||
21 | /** |
||
22 | * @var \DateTime|null |
||
23 | * |
||
24 | * @ORM\Column(name="updated_at", type="datetime", nullable=true) |
||
25 | */ |
||
26 | protected $updatedAt; |
||
27 | |||
28 | public function __construct() |
||
32 | |||
33 | /** |
||
34 | * @ORM\PrePersist() |
||
35 | */ |
||
36 | public function _timestampable_prePersist(): void |
||
40 | |||
41 | /** |
||
42 | * @ORM\PreUpdate() |
||
43 | */ |
||
44 | public function _timestampable_preUpdate(): void |
||
48 | |||
49 | public function getCreatedAt(): ?\DateTime |
||
53 | |||
54 | public function setCreatedAt(?\DateTime $createdAt): self |
||
60 | |||
61 | public function getUpdatedAt(): ?\DateTime |
||
65 | |||
66 | public function setUpdatedAt(?\DateTime $updatedAt): self |
||
72 | } |
||
73 |