|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace PiouPiou\RibsAdminBundle\Entity; |
|
4
|
|
|
|
|
5
|
|
|
use Doctrine\ORM\Mapping as ORM; |
|
6
|
|
|
|
|
7
|
|
|
trait CreatedUpdatedTrait |
|
8
|
|
|
{ |
|
9
|
|
|
/** |
|
10
|
|
|
* @ORM\Column(name="created_at", type="datetime", nullable=true) |
|
11
|
|
|
*/ |
|
12
|
|
|
protected $created_at; |
|
13
|
|
|
|
|
14
|
|
|
/** |
|
15
|
|
|
* @ORM\ManyToOne(targetEntity="PiouPiou\RibsAdminBundle\Entity\User") |
|
16
|
|
|
* @ORM\JoinColumn(name="created_by", referencedColumnName="id", nullable=false) |
|
17
|
|
|
*/ |
|
18
|
|
|
protected $created_by; |
|
19
|
|
|
|
|
20
|
|
|
/** |
|
21
|
|
|
* @ORM\Column(name="updated_at", type="datetime", nullable=true) |
|
22
|
|
|
*/ |
|
23
|
|
|
protected $updated_at; |
|
24
|
|
|
|
|
25
|
|
|
/** |
|
26
|
|
|
* @ORM\ManyToOne(targetEntity="PiouPiou\RibsAdminBundle\Entity\User") |
|
27
|
|
|
* @ORM\JoinColumn(name="updated_by", referencedColumnName="id", nullable=false) |
|
28
|
|
|
*/ |
|
29
|
|
|
protected $updated_by; |
|
30
|
|
|
|
|
31
|
|
|
/** |
|
32
|
|
|
* @return mixed |
|
33
|
|
|
*/ |
|
34
|
|
|
public function getCreatedAt() |
|
35
|
|
|
{ |
|
36
|
|
|
return $this->created_at; |
|
37
|
|
|
} |
|
38
|
|
|
|
|
39
|
|
|
/** |
|
40
|
|
|
* @param mixed $created_at |
|
41
|
|
|
*/ |
|
42
|
|
|
public function setCreatedAt($created_at) |
|
43
|
|
|
{ |
|
44
|
|
|
$this->created_at = $created_at; |
|
45
|
|
|
} |
|
46
|
|
|
|
|
47
|
|
|
/** |
|
48
|
|
|
* @return mixed |
|
49
|
|
|
*/ |
|
50
|
|
|
public function getCreatedBy() |
|
51
|
|
|
{ |
|
52
|
|
|
return $this->created_by; |
|
53
|
|
|
} |
|
54
|
|
|
|
|
55
|
|
|
/** |
|
56
|
|
|
* @ORM\PrePersist |
|
57
|
|
|
* @param mixed $created_by |
|
58
|
|
|
*/ |
|
59
|
|
|
public function setCreatedBy($created_by) |
|
60
|
|
|
{ |
|
61
|
|
|
$this->created_by = $created_by; |
|
62
|
|
|
} |
|
63
|
|
|
|
|
64
|
|
|
/** |
|
65
|
|
|
* @return mixed |
|
66
|
|
|
*/ |
|
67
|
|
|
public function getUpdatedAt() |
|
68
|
|
|
{ |
|
69
|
|
|
return $this->updated_at; |
|
70
|
|
|
} |
|
71
|
|
|
|
|
72
|
|
|
/** |
|
73
|
|
|
* @param mixed $updated_at |
|
74
|
|
|
*/ |
|
75
|
|
|
public function setUpdatedAt($updated_at) |
|
76
|
|
|
{ |
|
77
|
|
|
$this->updated_at = $updated_at; |
|
78
|
|
|
} |
|
79
|
|
|
|
|
80
|
|
|
/** |
|
81
|
|
|
* @return mixed |
|
82
|
|
|
*/ |
|
83
|
|
|
public function getUpdatedBy() |
|
84
|
|
|
{ |
|
85
|
|
|
return $this->updated_by; |
|
86
|
|
|
} |
|
87
|
|
|
|
|
88
|
|
|
/** |
|
89
|
|
|
* @ORM\PreUpdate |
|
90
|
|
|
* @param mixed $updated_by |
|
91
|
|
|
*/ |
|
92
|
|
|
public function setUpdatedBy($updated_by) |
|
93
|
|
|
{ |
|
94
|
|
|
$this->updated_by = $updated_by; |
|
95
|
|
|
} |
|
96
|
|
|
} |
|
97
|
|
|
|