1 | <?php |
||
15 | final class ComponentPayload |
||
16 | { |
||
17 | /** @var string */ |
||
18 | private $type; |
||
19 | |||
20 | /** @var array */ |
||
21 | private $properties = []; |
||
22 | |||
23 | /** @var array */ |
||
24 | private $subComponents = []; |
||
25 | |||
26 | public static function create(string $type): ComponentPayload |
||
30 | |||
31 | public function __construct(string $type) |
||
35 | |||
36 | public function property(PropertyType $property, array $parameters = null): ComponentPayload |
||
44 | |||
45 | /** |
||
46 | * @param array|string $names |
||
47 | * @param \DateTimeInterface|null $value |
||
48 | * @param bool $withTime |
||
49 | * @param bool $withTimeZone |
||
50 | * |
||
51 | * @return \Spatie\IcalendarGenerator\ComponentPayload |
||
52 | */ |
||
53 | public function dateTimeProperty( |
||
65 | |||
66 | /** |
||
67 | * @param array|string $names |
||
68 | * @param string|\Spatie\Enum\Enum|null $value |
||
69 | * |
||
70 | * @param bool $disableEscaping |
||
71 | * |
||
72 | * @return \Spatie\IcalendarGenerator\ComponentPayload |
||
73 | */ |
||
74 | public function textProperty( |
||
89 | |||
90 | /** |
||
91 | * @param array|string $names |
||
92 | * @param string|null $value |
||
93 | * |
||
94 | * @return \Spatie\IcalendarGenerator\ComponentPayload |
||
95 | */ |
||
96 | public function uriProperty($names, ?string $value): ComponentPayload |
||
104 | |||
105 | public function subComponent(Component ...$components): ComponentPayload |
||
113 | |||
114 | public function when(bool $condition, Closure $closure): ComponentPayload |
||
122 | |||
123 | public function getType(): string |
||
127 | |||
128 | public function getProperties(): array |
||
132 | |||
133 | public function getProperty(string $name): PropertyType |
||
150 | |||
151 | public function getSubComponents(): array |
||
155 | } |
||
156 |