Total Complexity | 5 |
Total Lines | 32 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 0 |
1 | <?php |
||
19 | trait TimestampedTrait |
||
20 | { |
||
21 | public ?\DateTimeImmutable $createdAt = null; |
||
22 | |||
23 | public ?\DateTime $modifiedAt = null; |
||
24 | |||
25 | /** @return static */ |
||
26 | public function setCreatedAt(\DateTimeImmutable $createdAt) |
||
27 | { |
||
28 | if (!$this->createdAt) { |
||
29 | $this->createdAt = $createdAt; |
||
30 | } |
||
31 | |||
32 | return $this; |
||
33 | } |
||
34 | |||
35 | public function getCreatedAt(): ?\DateTimeImmutable |
||
36 | { |
||
37 | return $this->createdAt; |
||
38 | } |
||
39 | |||
40 | /** @return static */ |
||
41 | public function setModifiedAt(\DateTime $modifiedAt) |
||
42 | { |
||
43 | $this->modifiedAt = $modifiedAt; |
||
44 | |||
45 | return $this; |
||
46 | } |
||
47 | |||
48 | public function getModifiedAt(): ?\DateTime |
||
51 | } |
||
52 | } |
||
53 |