1 | <?php |
||
11 | class DateIntervalHandler implements DataTypeHandlerInterface |
||
12 | { |
||
13 | const PARAMETER_FORMAT = 0; |
||
14 | |||
15 | /** |
||
16 | * {@inheritdoc} |
||
17 | */ |
||
18 | 3 | public function toResource($value, string $type, array $parameters) |
|
38 | |||
39 | /** |
||
40 | * Resolve ISO_8601 duration format |
||
41 | * |
||
42 | * @param \DateInterval $interval |
||
43 | * @return string | null |
||
44 | */ |
||
45 | 2 | protected function resolveFormat(\DateInterval $interval): string |
|
64 | |||
65 | /** |
||
66 | * Resolve base part of interval format |
||
67 | * |
||
68 | * @param \DateInterval $interval |
||
69 | * @return string |
||
70 | */ |
||
71 | 2 | protected function resolveBaseFormat(\DateInterval $interval): string |
|
89 | |||
90 | /** |
||
91 | * Resolve time part of interval format |
||
92 | * |
||
93 | * @param \DateInterval $interval |
||
94 | * @return string |
||
95 | */ |
||
96 | 2 | protected function resolveTimeFormat(\DateInterval $interval): string |
|
114 | |||
115 | /** |
||
116 | * {@inheritdoc} |
||
117 | */ |
||
118 | 1 | public function fromResource($value, string $type, array $parameters) |
|
130 | |||
131 | /** |
||
132 | * {@inheritdoc} |
||
133 | */ |
||
134 | public function supports(): array |
||
138 | } |