1 | <?php |
||
20 | class Link |
||
21 | { |
||
22 | /** @var string */ |
||
23 | protected $title; |
||
24 | |||
25 | /** @var \DateTime */ |
||
26 | protected $from; |
||
27 | |||
28 | /** @var \DateTime */ |
||
29 | protected $to; |
||
30 | |||
31 | /** @var string */ |
||
32 | protected $description; |
||
33 | |||
34 | /** @var bool */ |
||
35 | protected $allDay; |
||
36 | |||
37 | /** @var string */ |
||
38 | protected $address; |
||
39 | |||
40 | public function __construct(string $title, DateTime $from, DateTime $to, bool $allDay = false) |
||
52 | |||
53 | /** |
||
54 | * @param string $title |
||
55 | * @param \DateTime $from |
||
56 | * @param \DateTime $to |
||
57 | * @param bool $allDay |
||
58 | * |
||
59 | * @return static |
||
60 | * @throws InvalidLink |
||
61 | */ |
||
62 | public static function create(string $title, DateTime $from, DateTime $to, bool $allDay = false) |
||
66 | |||
67 | /** |
||
68 | * @param string $title |
||
69 | * @param DateTime $fromDate |
||
70 | * @param int $numberOfDays |
||
71 | * |
||
72 | * @return Link |
||
73 | * @throws InvalidLink |
||
74 | */ |
||
75 | public static function createAllDay(string $title, DateTime $fromDate, int $numberOfDays = 1): self |
||
82 | |||
83 | /** |
||
84 | * @param string $description |
||
85 | * |
||
86 | * @return $this |
||
87 | */ |
||
88 | public function description(string $description) |
||
94 | |||
95 | /** |
||
96 | * @param string $address |
||
97 | * |
||
98 | * @return $this |
||
99 | */ |
||
100 | public function address(string $address) |
||
106 | |||
107 | public function formatWith(Generator $generator): string |
||
111 | |||
112 | public function google(): string |
||
116 | |||
117 | public function ics(): string |
||
121 | |||
122 | public function yahoo(): string |
||
126 | |||
127 | public function webOutlook(): string |
||
131 | |||
132 | public function __get($property) |
||
136 | } |
||
137 |