| @@ 177-188 (lines=12) @@ | ||
| 174 | /** |
|
| 175 | * @return UserPrincipalResponse |
|
| 176 | */ |
|
| 177 | public function getUserPrincipal() |
|
| 178 | { |
|
| 179 | $http_response = $this->makeRequest( |
|
| 180 | RequestFactory::createPropFindRequest |
|
| 181 | ( |
|
| 182 | $this->server_url, |
|
| 183 | CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::PrincipalRequestType)->getContent() |
|
| 184 | ) |
|
| 185 | ); |
|
| 186 | ||
| 187 | return new UserPrincipalResponse($this->server_url, (string)$http_response->getBody(), $http_response->getStatusCode()); |
|
| 188 | } |
|
| 189 | ||
| 190 | /** |
|
| 191 | * @param string $principal_url |
|
| @@ 194-205 (lines=12) @@ | ||
| 191 | * @param string $principal_url |
|
| 192 | * @return CalendarHomesResponse |
|
| 193 | */ |
|
| 194 | public function getCalendarHome($principal_url) |
|
| 195 | { |
|
| 196 | $http_response = $this->makeRequest( |
|
| 197 | RequestFactory::createPropFindRequest |
|
| 198 | ( |
|
| 199 | $principal_url, |
|
| 200 | CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::CalendarHomeRequestType)->getContent() |
|
| 201 | ) |
|
| 202 | ); |
|
| 203 | ||
| 204 | return new CalendarHomesResponse($this->server_url, (string)$http_response->getBody(), $http_response->getStatusCode()); |
|
| 205 | } |
|
| 206 | ||
| 207 | /** |
|
| 208 | * @param string $calendar_home_set |
|
| @@ 230-241 (lines=12) @@ | ||
| 227 | * @param string $calendar_home_set_url |
|
| 228 | * @return GetCalendarsResponse |
|
| 229 | */ |
|
| 230 | public function getCalendars($calendar_home_set_url) |
|
| 231 | { |
|
| 232 | $http_response = $this->makeRequest( |
|
| 233 | RequestFactory::createPropFindRequest |
|
| 234 | ( |
|
| 235 | $calendar_home_set_url, |
|
| 236 | CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::CalendarsRequestType)->getContent() |
|
| 237 | ) |
|
| 238 | ); |
|
| 239 | ||
| 240 | return new GetCalendarsResponse($this->server_url, (string)$http_response->getBody(), $http_response->getStatusCode()); |
|
| 241 | } |
|
| 242 | ||
| 243 | /** |
|
| 244 | * @param string $calendar_url |
|
| @@ 247-259 (lines=13) @@ | ||
| 244 | * @param string $calendar_url |
|
| 245 | * @return GetCalendarResponse |
|
| 246 | */ |
|
| 247 | public function getCalendar($calendar_url) |
|
| 248 | { |
|
| 249 | $http_response = $this->makeRequest( |
|
| 250 | RequestFactory::createPropFindRequest |
|
| 251 | ( |
|
| 252 | $calendar_url, |
|
| 253 | CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::CalendarRequestType)->getContent(), |
|
| 254 | 0 |
|
| 255 | ) |
|
| 256 | ); |
|
| 257 | ||
| 258 | return new GetCalendarResponse($this->server_url, (string)$http_response->getBody(), $http_response->getStatusCode()); |
|
| 259 | } |
|
| 260 | ||
| 261 | ||
| 262 | /** |
|
| @@ 267-279 (lines=13) @@ | ||
| 264 | * @param string $sync_token |
|
| 265 | * @return CalendarSyncInfoResponse |
|
| 266 | */ |
|
| 267 | public function getCalendarSyncInfo($calendar_url, $sync_token) |
|
| 268 | { |
|
| 269 | ||
| 270 | $http_response = $this->makeRequest( |
|
| 271 | RequestFactory::createReportRequest |
|
| 272 | ( |
|
| 273 | $calendar_url, |
|
| 274 | CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::CalendarSyncRequestType, [$sync_token])->getContent() |
|
| 275 | ) |
|
| 276 | ); |
|
| 277 | ||
| 278 | return new CalendarSyncInfoResponse($this->server_url, (string)$http_response->getBody(), $http_response->getStatusCode()); |
|
| 279 | } |
|
| 280 | ||
| 281 | /** |
|
| 282 | * @param string $calendar_url |
|
| @@ 380-396 (lines=17) @@ | ||
| 377 | * @param array $events_urls |
|
| 378 | * @return ResourceCollectionResponse |
|
| 379 | */ |
|
| 380 | public function getEventsBy($calendar_url, array $events_urls) |
|
| 381 | { |
|
| 382 | $http_response = $this->makeRequest( |
|
| 383 | RequestFactory::createReportRequest |
|
| 384 | ( |
|
| 385 | $calendar_url, |
|
| 386 | CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::CalendarMultiGetRequestType, [$events_urls])->getContent() |
|
| 387 | ) |
|
| 388 | ); |
|
| 389 | ||
| 390 | return new ResourceCollectionResponse |
|
| 391 | ( |
|
| 392 | $this->server_url, |
|
| 393 | (string)$http_response->getBody(), |
|
| 394 | $http_response->getStatusCode() |
|
| 395 | ); |
|
| 396 | } |
|
| 397 | ||
| 398 | /** |
|
| 399 | * @param string $calendar_url |
|
| @@ 403-420 (lines=18) @@ | ||
| 400 | * @param CalendarQueryFilter $filter |
|
| 401 | * @return ResourceCollectionResponse |
|
| 402 | */ |
|
| 403 | public function getEventsByQuery($calendar_url, CalendarQueryFilter $filter) |
|
| 404 | { |
|
| 405 | ||
| 406 | $http_response = $this->makeRequest( |
|
| 407 | RequestFactory::createReportRequest |
|
| 408 | ( |
|
| 409 | $calendar_url, |
|
| 410 | CalDAVRequestFactory::getInstance()->build(CalDAVRequestFactory::CalendarQueryRequestType, [$filter])->getContent() |
|
| 411 | ) |
|
| 412 | ); |
|
| 413 | ||
| 414 | return new ResourceCollectionResponse |
|
| 415 | ( |
|
| 416 | $this->server_url, |
|
| 417 | (string)$http_response->getBody(), |
|
| 418 | $http_response->getStatusCode() |
|
| 419 | ); |
|
| 420 | } |
|
| 421 | ||
| 422 | /** |
|
| 423 | * @param string $calendar_url |
|