1 | <?php |
||
16 | class Basket |
||
17 | { |
||
18 | |||
19 | 2 | public static function fromList(array $values) |
|
29 | |||
30 | 2 | public static function fromValue(\stdClass $value) |
|
34 | |||
35 | /** |
||
36 | * @var \stdClass |
||
37 | */ |
||
38 | protected $source; |
||
39 | |||
40 | /** |
||
41 | * @var User|null |
||
42 | */ |
||
43 | protected $owner; |
||
44 | |||
45 | /** |
||
46 | * @var User|null |
||
47 | */ |
||
48 | protected $pusher; |
||
49 | |||
50 | /** |
||
51 | * @var \DateTime |
||
52 | */ |
||
53 | protected $createdOn; |
||
54 | |||
55 | /** |
||
56 | * @var \DateTime |
||
57 | */ |
||
58 | protected $updatedOn; |
||
59 | |||
60 | /** |
||
61 | * ArrayCollection|User[] |
||
62 | */ |
||
63 | protected $validationUsers; |
||
64 | |||
65 | /** |
||
66 | * @var \DateTime |
||
67 | */ |
||
68 | protected $expiresOn; |
||
69 | |||
70 | /** |
||
71 | * @var User|null |
||
72 | */ |
||
73 | protected $validationInitiatorUser; |
||
74 | |||
75 | 2 | public function __construct(\stdClass $source) |
|
79 | |||
80 | /** |
||
81 | * @return \stdClass |
||
82 | */ |
||
83 | public function getRawData() |
||
87 | |||
88 | /** |
||
89 | * The basket id |
||
90 | * |
||
91 | * @return integer |
||
92 | */ |
||
93 | 2 | public function getId() |
|
97 | |||
98 | /** |
||
99 | * The basket name |
||
100 | * |
||
101 | * @return string |
||
102 | */ |
||
103 | 2 | public function getName() |
|
107 | |||
108 | /** |
||
109 | * The basket description |
||
110 | * |
||
111 | * @return string |
||
112 | */ |
||
113 | 2 | public function getDescription() |
|
117 | |||
118 | /** |
||
119 | * The user who created the basket when the current basket |
||
120 | * is a validation basket |
||
121 | * |
||
122 | * @return integer|null |
||
123 | */ |
||
124 | public function getPusher() |
||
128 | |||
129 | /** |
||
130 | * Tell whether the basket has been read or not |
||
131 | * |
||
132 | * @return Boolean |
||
133 | */ |
||
134 | 2 | public function isUnread() |
|
138 | |||
139 | /** |
||
140 | * Creation date |
||
141 | * |
||
142 | * @return \DateTime |
||
143 | */ |
||
144 | 2 | public function getCreatedOn() |
|
148 | |||
149 | /** |
||
150 | * Last update date |
||
151 | * |
||
152 | * @return \DateTime |
||
153 | */ |
||
154 | 2 | public function getUpdatedOn() |
|
158 | |||
159 | /** |
||
160 | * Tell whether the basket is a validation basket |
||
161 | * |
||
162 | * @return Boolean |
||
163 | */ |
||
164 | 2 | public function isValidationBasket() |
|
168 | |||
169 | /** |
||
170 | * Return a collection of PhraseanetSDK\entity\BasketValidationParticipant object |
||
171 | * if the basket is a validation basket otherwise it returns null |
||
172 | * |
||
173 | * @return ArrayCollection|null |
||
174 | */ |
||
175 | 2 | public function getValidationUsers() |
|
185 | |||
186 | /** |
||
187 | * The expiration validation date, if the basket is a validation basket |
||
188 | * |
||
189 | * @return \DateTime|null |
||
190 | */ |
||
191 | 2 | public function getExpiresOn() |
|
195 | |||
196 | /** |
||
197 | * Get some information about the validation, if the basket is a validation |
||
198 | * basket |
||
199 | * |
||
200 | * @return string|null |
||
201 | */ |
||
202 | 2 | public function getValidationInfo() |
|
206 | |||
207 | /** |
||
208 | * Tell whether the validation is confirmed |
||
209 | * |
||
210 | * @return bool |
||
211 | */ |
||
212 | 2 | public function isValidationConfirmed() |
|
216 | |||
217 | /** |
||
218 | * Tell whether the current authenticated user initiates the validation process |
||
219 | * |
||
220 | * @return bool |
||
221 | */ |
||
222 | 2 | public function isValidationInitiator() |
|
226 | |||
227 | /** |
||
228 | * @return User|null |
||
229 | */ |
||
230 | public function getValidationInitiatorUser() |
||
236 | |||
237 | /** |
||
238 | * @return User |
||
239 | */ |
||
240 | public function getOwner() |
||
244 | } |
||
245 |