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 DateTimeZone; |
16
|
|
|
|
17
|
|
|
/** |
18
|
|
|
* Class MakeCalendarRequestVO |
19
|
|
|
* @package CalDAVClient\Facade\Requests |
20
|
|
|
*/ |
21
|
|
|
final class MakeCalendarRequestVO |
22
|
|
|
{ |
23
|
|
|
/** |
24
|
|
|
* @var DateTimeZone |
25
|
|
|
*/ |
26
|
|
|
private $timezone; |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* @var string |
30
|
|
|
*/ |
31
|
|
|
private $resource_name; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* @var null|string |
35
|
|
|
*/ |
36
|
|
|
private $display_name; |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* @var null|string |
40
|
|
|
*/ |
41
|
|
|
private $description; |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* MakeCalendarRequestDTO constructor. |
45
|
|
|
* @param string $resource_name |
46
|
|
|
* @param string|null $display_name |
47
|
|
|
* @param string|null $description |
48
|
|
|
* @param DateTimeZone|null $timezone |
49
|
|
|
*/ |
50
|
|
|
public function __construct($resource_name, $display_name = null, $description = null, DateTimeZone $timezone = null) |
51
|
|
|
{ |
52
|
|
|
$this->resource_name = strtolower($resource_name); |
53
|
|
|
$this->display_name = $display_name; |
54
|
|
|
$this->description = $description; |
55
|
|
|
$this->timezone = $timezone; |
56
|
|
|
|
57
|
|
|
if(is_null($this->timezone)){ |
58
|
|
|
$this->timezone = new DateTimeZone('UTC'); |
59
|
|
|
} |
60
|
|
|
} |
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* @return DateTimeZone |
64
|
|
|
*/ |
65
|
|
|
public function getTimezone() |
66
|
|
|
{ |
67
|
|
|
return $this->timezone; |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* @return string |
72
|
|
|
*/ |
73
|
|
|
public function getResourceName() |
74
|
|
|
{ |
75
|
|
|
return $this->resource_name; |
76
|
|
|
} |
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* @return null|string |
80
|
|
|
*/ |
81
|
|
|
public function getDisplayName() |
82
|
|
|
{ |
83
|
|
|
return $this->display_name; |
84
|
|
|
} |
85
|
|
|
|
86
|
|
|
/** |
87
|
|
|
* @return null|string |
88
|
|
|
*/ |
89
|
|
|
public function getDescription() |
90
|
|
|
{ |
91
|
|
|
return $this->description; |
92
|
|
|
} |
93
|
|
|
} |