1 | <?php |
||
14 | final class ComponentPayload |
||
15 | { |
||
16 | /** @var string */ |
||
17 | private $type; |
||
18 | |||
19 | /** @var array */ |
||
20 | private $properties = []; |
||
21 | |||
22 | /** @var array */ |
||
23 | private $subComponents = []; |
||
24 | |||
25 | public static function create(string $type): ComponentPayload |
||
29 | |||
30 | public function __construct(string $type) |
||
34 | |||
35 | public function property(PropertyType $property, array $parameters = null): ComponentPayload |
||
43 | |||
44 | /** |
||
45 | * @param array|string $names |
||
46 | * @param \DateTimeInterface|null $value |
||
47 | * @param bool $withTime |
||
48 | * @param bool $withTimeZone |
||
49 | * |
||
50 | * @return \Spatie\IcalendarGenerator\ComponentPayload |
||
51 | */ |
||
52 | public function dateTimeProperty( |
||
64 | |||
65 | /** |
||
66 | * @param array|string $names |
||
67 | * @param string|null $value |
||
68 | * |
||
69 | * @param bool $disableEscaping |
||
70 | * |
||
71 | * @return \Spatie\IcalendarGenerator\ComponentPayload |
||
72 | */ |
||
73 | public function textProperty( |
||
84 | |||
85 | /** |
||
86 | * @param array|string $names |
||
87 | * @param string|null $value |
||
88 | * |
||
89 | * @return \Spatie\IcalendarGenerator\ComponentPayload |
||
90 | */ |
||
91 | public function uriProperty( |
||
101 | |||
102 | public function subComponent(Component ...$components): ComponentPayload |
||
110 | |||
111 | public function when(bool $condition, Closure $closure): ComponentPayload |
||
119 | |||
120 | public function getType(): string |
||
124 | |||
125 | public function getProperties(): array |
||
129 | |||
130 | public function getProperty(string $name): PropertyType |
||
147 | |||
148 | public function getSubComponents(): array |
||
152 | } |
||
153 |