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 | public function __construct() |
||
72 | |||
73 | /** |
||
74 | * Get id. |
||
75 | * |
||
76 | * @return int |
||
77 | */ |
||
78 | 1 | public function getId() |
|
82 | |||
83 | /** |
||
84 | * Set type. |
||
85 | * |
||
86 | * @param $type |
||
87 | * |
||
88 | * @return FormRequest |
||
89 | */ |
||
90 | public function setType($type) |
||
98 | |||
99 | /** |
||
100 | * Get type. |
||
101 | * |
||
102 | * @return string |
||
103 | */ |
||
104 | 1 | public function getType() |
|
108 | |||
109 | /** |
||
110 | * Set status. |
||
111 | * |
||
112 | * @param string $status |
||
113 | * |
||
114 | * @return FormRequest |
||
115 | */ |
||
116 | public function setStatus($status) |
||
124 | |||
125 | /** |
||
126 | * Get status. |
||
127 | * |
||
128 | * @return string |
||
129 | */ |
||
130 | 1 | public function getStatus() |
|
134 | |||
135 | /** |
||
136 | * Set user. |
||
137 | * |
||
138 | * @param User $user |
||
139 | * |
||
140 | * @return FormRequest |
||
141 | */ |
||
142 | public function setUser(User $user) |
||
148 | |||
149 | /** |
||
150 | * Get user. |
||
151 | * |
||
152 | * @return User |
||
153 | */ |
||
154 | public function getUser() |
||
158 | |||
159 | /** |
||
160 | * Set date. |
||
161 | * |
||
162 | * @param \DateTime $date |
||
163 | * |
||
164 | * @return FormRequest |
||
165 | */ |
||
166 | public function setDate($date) |
||
172 | /** |
||
173 | * Get date. |
||
174 | * |
||
175 | * @return \DateTime |
||
176 | */ |
||
177 | 1 | public function getDate() |
|
181 | } |
||
182 |