1 | <?php |
||
15 | class FormRequest |
||
16 | { |
||
17 | use ORMBehaviors\Timestampable\Timestampable; |
||
18 | |||
19 | const STATUS = ['pending', 'approved', 'rejected']; |
||
20 | |||
21 | /** |
||
22 | * @var int |
||
23 | * |
||
24 | * @ORM\Column(name="id", type="integer") |
||
25 | * @ORM\Id |
||
26 | * @ORM\GeneratedValue(strategy="AUTO") |
||
27 | */ |
||
28 | private $id; |
||
29 | |||
30 | /** |
||
31 | * @var FormRequestType |
||
32 | * @Assert\Type("object") |
||
33 | * @Assert\Valid |
||
34 | * @ORM\ManyToOne(targetEntity="FormRequestType", inversedBy="requests") |
||
35 | * @Groups({"Detail"}) |
||
36 | */ |
||
37 | private $type; |
||
38 | |||
39 | /** |
||
40 | * @var string |
||
41 | * @Assert\NotBlank() |
||
42 | * @Assert\Type("string") |
||
43 | * @Assert\Length( |
||
44 | * max = 255 |
||
45 | * ) |
||
46 | * @ORM\Column(type="string", length=255) |
||
47 | * @Groups({"Detail"}) |
||
48 | */ |
||
49 | private $status; |
||
50 | |||
51 | /** |
||
52 | * @var User |
||
53 | * @Assert\Type("object") |
||
54 | * @Assert\Valid |
||
55 | * @ORM\ManyToOne(targetEntity="User", inversedBy="formRequests") |
||
56 | */ |
||
57 | private $user; |
||
58 | |||
59 | /** |
||
60 | * @var \DateTime |
||
61 | * @Assert\Date() |
||
62 | * @ORM\Column(type="datetime") |
||
63 | * @Groups({"Detail"}) |
||
64 | */ |
||
65 | private $date; |
||
66 | |||
67 | public function __construct() |
||
71 | |||
72 | /** |
||
73 | * Get id. |
||
74 | * |
||
75 | * @return int |
||
76 | */ |
||
77 | 1 | public function getId() |
|
81 | |||
82 | /** |
||
83 | * Set type. |
||
84 | * |
||
85 | * @param FormRequestType $type |
||
86 | * |
||
87 | * @return FormRequest |
||
88 | */ |
||
89 | public function setType(FormRequestType $type) |
||
95 | |||
96 | /** |
||
97 | * Get type. |
||
98 | * |
||
99 | * @return FormRequestType |
||
100 | */ |
||
101 | 1 | public function getType() |
|
105 | |||
106 | /** |
||
107 | * Set status. |
||
108 | * |
||
109 | * @param string $status |
||
110 | * |
||
111 | * @return FormRequest |
||
112 | */ |
||
113 | public function setStatus($status) |
||
120 | |||
121 | /** |
||
122 | * Get status. |
||
123 | * |
||
124 | * @return string |
||
125 | */ |
||
126 | 1 | public function getStatus() |
|
130 | |||
131 | /** |
||
132 | * Set user. |
||
133 | * |
||
134 | * @param User $user |
||
135 | * |
||
136 | * @return FormRequest |
||
137 | */ |
||
138 | public function setUser(User $user) |
||
144 | |||
145 | /** |
||
146 | * Get user. |
||
147 | * |
||
148 | * @return User |
||
149 | */ |
||
150 | public function getUser() |
||
154 | |||
155 | /** |
||
156 | * Set date. |
||
157 | * |
||
158 | * @param \DateTime $date |
||
159 | * |
||
160 | * @return FormRequest |
||
161 | */ |
||
162 | public function setDate($date) |
||
168 | /** |
||
169 | * Get date. |
||
170 | * |
||
171 | * @return \DateTime |
||
172 | */ |
||
173 | 1 | public function getDate() |
|
177 | } |
||
178 |