1
|
|
|
<?php namespace CalDAVClient\Facade\Requests; |
2
|
|
|
/** |
3
|
|
|
* Copyright 2017 OpenStack Foundation |
4
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
5
|
|
|
* you may not use this file except in compliance with the License. |
6
|
|
|
* You may obtain a copy of the License at |
7
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0 |
8
|
|
|
* Unless required by applicable law or agreed to in writing, software |
9
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, |
10
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
11
|
|
|
* See the License for the specific language governing permissions and |
12
|
|
|
* limitations under the License. |
13
|
|
|
**/ |
14
|
|
|
|
15
|
|
|
use Sabre\Xml\Service; |
16
|
|
|
|
17
|
|
|
/** |
18
|
|
|
* Class AbstractPropFindWebDAVRequest |
19
|
|
|
* @package CalDAVClient\Facade\Requests |
20
|
|
|
* @see https://tools.ietf.org/html/rfc2518#section-8.1 |
21
|
|
|
*/ |
22
|
|
|
abstract class AbstractPropFindWebDAVRequest implements IAbstractWebDAVRequest |
23
|
|
|
{ |
24
|
|
|
protected $properties = []; |
25
|
|
|
|
26
|
|
|
/** |
27
|
|
|
* @return string |
28
|
|
|
*/ |
29
|
|
|
public function getContent() |
30
|
|
|
{ |
31
|
|
|
$service = new Service(); |
32
|
|
|
|
33
|
|
|
$service->namespaceMap = [ |
34
|
|
|
'DAV:' => 'D', |
35
|
|
|
'urn:ietf:params:xml:ns:caldav' => 'C', |
36
|
|
|
'http://calendarserver.org/ns/' => 'CS', |
37
|
|
|
]; |
38
|
|
|
|
39
|
|
|
$elements = []; |
40
|
|
|
foreach( $this->properties as $val ) { |
41
|
|
|
$elements[] = [ $val => "" ]; |
42
|
|
|
} |
43
|
|
|
return $service->write('{DAV:}propfind', |
44
|
|
|
[ |
45
|
|
|
'{DAV:}prop' => $elements |
46
|
|
|
]); |
47
|
|
|
|
48
|
|
|
} |
49
|
|
|
} |