Total Complexity | 5 |
Total Lines | 50 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
12 | trait TimestampedEntityTrait |
||
13 | { |
||
14 | /** |
||
15 | * @ORM\Column(type="datetime_immutable", options={"default" = "CURRENT_TIMESTAMP"}) |
||
16 | * @var DateTimeImmutable |
||
17 | */ |
||
18 | protected $created; |
||
19 | |||
20 | /** |
||
21 | * @ORM\Column(type="datetime", options={"default" = "CURRENT_TIMESTAMP"}) |
||
22 | * @var DateTime |
||
23 | */ |
||
24 | protected $modified; |
||
25 | |||
26 | /** |
||
27 | * @return DateTimeImmutable |
||
28 | */ |
||
29 | public function getCreated(): DateTimeImmutable |
||
32 | } |
||
33 | |||
34 | /** |
||
35 | * @param DateTimeImmutable $created |
||
36 | * @return static |
||
37 | */ |
||
38 | public function setCreated(DateTimeImmutable $created) |
||
39 | { |
||
40 | if (!$this->created) { |
||
41 | $this->created = $created; |
||
42 | } |
||
43 | return $this; |
||
44 | } |
||
45 | |||
46 | /** |
||
47 | * @return DateTime |
||
48 | */ |
||
49 | public function getModified(): DateTime |
||
50 | { |
||
51 | return $this->modified; |
||
52 | } |
||
53 | |||
54 | /** |
||
55 | * @param DateTime $modified |
||
56 | * @return static |
||
57 | */ |
||
58 | public function setModified(DateTime $modified) |
||
62 | } |
||
63 | } |
||
64 |