1 | <?php |
||
15 | class FormRequest |
||
16 | { |
||
17 | use ORMBehaviors\Timestampable\Timestampable; |
||
18 | |||
19 | const STATUS = ['pending', 'approved', 'rejected']; |
||
20 | const TYPE = ['personal day', 'overnight guest', 'sick day']; |
||
21 | |||
22 | /** |
||
23 | * @var int |
||
24 | * |
||
25 | * @ORM\Column(name="id", type="integer") |
||
26 | * @ORM\Id |
||
27 | * @ORM\GeneratedValue(strategy="AUTO") |
||
28 | */ |
||
29 | private $id; |
||
30 | |||
31 | /** |
||
32 | * @var string |
||
33 | * @Assert\NotBlank() |
||
34 | * @Assert\Choice(FormRequest::TYPE) |
||
35 | * @ORM\Column(type="string", length=25) |
||
36 | * @Groups({"Detail"}) |
||
37 | */ |
||
38 | private $type; |
||
39 | |||
40 | /** |
||
41 | * @var string |
||
42 | * @Assert\NotBlank() |
||
43 | * @Assert\Type("string") |
||
44 | * @Assert\Length( |
||
45 | * max = 255 |
||
46 | * ) |
||
47 | * @ORM\Column(type="string", length=255) |
||
48 | * @Groups({"Detail"}) |
||
49 | */ |
||
50 | private $status; |
||
51 | |||
52 | /** |
||
53 | * @var User |
||
54 | * @Assert\Type("object") |
||
55 | * @Assert\Valid |
||
56 | * @ORM\ManyToOne(targetEntity="User", inversedBy="formRequests") |
||
57 | */ |
||
58 | private $user; |
||
59 | |||
60 | /** |
||
61 | * @var \DateTime |
||
62 | * @Assert\DateTime() |
||
63 | * @ORM\Column(type="datetime") |
||
64 | * @Groups({"Detail"}) |
||
65 | */ |
||
66 | private $date; |
||
67 | |||
68 | /** |
||
69 | * @var string |
||
70 | * |
||
71 | * @ORM\Column(type="text", nullable=true) |
||
72 | * @Groups({"Detail"}) |
||
73 | */ |
||
74 | private $reason; |
||
75 | |||
76 | public function __construct() |
||
80 | |||
81 | /** |
||
82 | * Get id. |
||
83 | * |
||
84 | * @return int |
||
85 | */ |
||
86 | 1 | public function getId() |
|
90 | |||
91 | /** |
||
92 | * Set type. |
||
93 | * |
||
94 | * @param $type |
||
95 | * |
||
96 | * @return FormRequest |
||
97 | */ |
||
98 | public function setType($type) |
||
106 | |||
107 | /** |
||
108 | * Get type. |
||
109 | * |
||
110 | * @return string |
||
111 | */ |
||
112 | 1 | public function getType() |
|
116 | |||
117 | /** |
||
118 | * Set status. |
||
119 | * |
||
120 | * @param string $status |
||
121 | * |
||
122 | * @return FormRequest |
||
123 | */ |
||
124 | public function setStatus($status) |
||
132 | |||
133 | /** |
||
134 | * Get status. |
||
135 | * |
||
136 | * @return string |
||
137 | */ |
||
138 | 1 | public function getStatus() |
|
142 | |||
143 | /** |
||
144 | * Set user. |
||
145 | * |
||
146 | * @param User $user |
||
147 | * |
||
148 | * @return FormRequest |
||
149 | */ |
||
150 | public function setUser(User $user) |
||
156 | |||
157 | /** |
||
158 | * Get user. |
||
159 | * |
||
160 | * @return User |
||
161 | */ |
||
162 | public function getUser() |
||
166 | |||
167 | /** |
||
168 | * Set date. |
||
169 | * |
||
170 | * @param \DateTime $date |
||
171 | * |
||
172 | * @return FormRequest |
||
173 | */ |
||
174 | public function setDate($date) |
||
180 | /** |
||
181 | * Get date. |
||
182 | * |
||
183 | * @return \DateTime |
||
184 | */ |
||
185 | 1 | public function getDate() |
|
189 | |||
190 | /** |
||
191 | * @return string |
||
192 | */ |
||
193 | 1 | public function getReason() |
|
197 | |||
198 | /** |
||
199 | * @param string $reason |
||
200 | * |
||
201 | * @return $this |
||
202 | */ |
||
203 | public function setReason($reason) |
||
209 | |||
210 | } |
||
211 |