1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
/* |
6
|
|
|
* This file is part of the Zikula package. |
7
|
|
|
* |
8
|
|
|
* Copyright Zikula Foundation - https://ziku.la/ |
9
|
|
|
* |
10
|
|
|
* For the full copyright and license information, please view the LICENSE |
11
|
|
|
* file that was distributed with this source code. |
12
|
|
|
*/ |
13
|
|
|
|
14
|
|
|
namespace Zikula\CategoriesModule\Traits; |
15
|
|
|
|
16
|
|
|
use DateTimeInterface; |
17
|
|
|
use Doctrine\ORM\Mapping as ORM; |
18
|
|
|
use Gedmo\Mapping\Annotation as Gedmo; |
19
|
|
|
use Zikula\UsersModule\Entity\UserEntity; |
20
|
|
|
|
21
|
|
|
/** |
22
|
|
|
* Standard fields trait. |
23
|
|
|
*/ |
24
|
|
|
trait StandardFieldsTrait |
25
|
|
|
{ |
26
|
|
|
/** |
27
|
|
|
* The user id of the creator of this entity |
28
|
|
|
* |
29
|
|
|
* @var UserEntity |
30
|
|
|
* @Gedmo\Blameable(on="create") |
31
|
|
|
* @ORM\ManyToOne(targetEntity="Zikula\UsersModule\Entity\UserEntity") |
32
|
|
|
* @ORM\JoinColumn(name="cr_uid", referencedColumnName="uid") |
33
|
|
|
*/ |
34
|
|
|
protected $createdBy; |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* The creation timestamp of this entity |
38
|
|
|
* |
39
|
|
|
* @var DateTime |
|
|
|
|
40
|
|
|
* @ORM\Column(type="datetime", name="cr_date") |
41
|
|
|
* @Gedmo\Timestampable(on="create") |
42
|
|
|
*/ |
43
|
|
|
protected $createdDate; |
44
|
|
|
|
45
|
|
|
/** |
46
|
|
|
* The user id of the last update of this entity |
47
|
|
|
* |
48
|
|
|
* @var UserEntity |
49
|
|
|
* @Gedmo\Blameable(on="update") |
50
|
|
|
* @ORM\ManyToOne(targetEntity="Zikula\UsersModule\Entity\UserEntity") |
51
|
|
|
* @ORM\JoinColumn(name="lu_uid", referencedColumnName="uid") |
52
|
|
|
*/ |
53
|
|
|
protected $updatedBy; |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* The last updated timestamp of this entity |
57
|
|
|
* |
58
|
|
|
* @var DateTime |
59
|
|
|
* @ORM\Column(type="datetime", name="lu_date") |
60
|
|
|
* @Gedmo\Timestampable(on="update") |
61
|
|
|
*/ |
62
|
|
|
protected $updatedDate; |
63
|
|
|
|
64
|
|
|
public function getCreatedBy(): UserEntity |
65
|
|
|
{ |
66
|
|
|
return $this->createdBy; |
67
|
|
|
} |
68
|
|
|
|
69
|
|
|
public function setCreatedBy(UserEntity $createdBy): void |
70
|
|
|
{ |
71
|
|
|
$this->createdBy = $createdBy; |
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
public function getCreatedDate(): DateTimeInterface |
75
|
|
|
{ |
76
|
|
|
return $this->createdDate; |
77
|
|
|
} |
78
|
|
|
|
79
|
|
|
public function setCreatedDate(DateTimeInterface $createdDate): void |
80
|
|
|
{ |
81
|
|
|
$this->createdDate = $createdDate; |
|
|
|
|
82
|
|
|
} |
83
|
|
|
|
84
|
|
|
public function getUpdatedBy(): UserEntity |
85
|
|
|
{ |
86
|
|
|
return $this->updatedBy; |
87
|
|
|
} |
88
|
|
|
|
89
|
|
|
public function setUpdatedBy(UserEntity $updatedBy): void |
90
|
|
|
{ |
91
|
|
|
$this->updatedBy = $updatedBy; |
92
|
|
|
} |
93
|
|
|
|
94
|
|
|
public function getUpdatedDate(): DateTimeInterface |
95
|
|
|
{ |
96
|
|
|
return $this->updatedDate; |
97
|
|
|
} |
98
|
|
|
|
99
|
|
|
public function setUpdatedDate(DateTimeInterface $updatedDate): void |
100
|
|
|
{ |
101
|
|
|
$this->updatedDate = $updatedDate; |
|
|
|
|
102
|
|
|
} |
103
|
|
|
} |
104
|
|
|
|