1 | <?php |
||
16 | class Extension extends \Twig_Extension |
||
17 | { |
||
18 | /** |
||
19 | * @var Formatter |
||
20 | */ |
||
21 | protected $formatter; |
||
22 | |||
23 | /** |
||
24 | * @var Converter |
||
25 | */ |
||
26 | protected $converter; |
||
27 | |||
28 | /** |
||
29 | * @var Comparator |
||
30 | */ |
||
31 | protected $comparator; |
||
32 | |||
33 | /** |
||
34 | * @param Formatter $formatter |
||
35 | * @param Converter $converter |
||
36 | * @param Comparator $comparator |
||
37 | */ |
||
38 | public function __construct(Formatter $formatter, Converter $converter, Comparator $comparator) |
||
44 | |||
45 | /** |
||
46 | * @return array |
||
47 | */ |
||
48 | public function getFilters() |
||
55 | |||
56 | /** |
||
57 | * @return array |
||
58 | */ |
||
59 | public function getFunctions() |
||
70 | |||
71 | /** |
||
72 | * @param \Twig_Environment $env |
||
73 | * @param mixed $date |
||
74 | * @param string|int|null $format |
||
75 | * |
||
76 | * @return string |
||
77 | */ |
||
78 | public function getDateFormat(\Twig_Environment $env, $date, $format = null) |
||
94 | |||
95 | /** |
||
96 | * @param mixed $date |
||
97 | * @param string $time_format |
||
98 | * @param string $month_format |
||
99 | * @param string $year_format |
||
100 | * |
||
101 | * @return string |
||
102 | */ |
||
103 | public function getDatePassed( |
||
112 | |||
113 | /** |
||
114 | * @param mixed $x |
||
115 | * @param string $operator |
||
116 | * @param mixed $y |
||
117 | * |
||
118 | * @return bool |
||
119 | */ |
||
120 | public function getCompareDateTime($x, $operator, $y) |
||
124 | |||
125 | /** |
||
126 | * @param mixed $x |
||
127 | * @param string $operator |
||
128 | * @param mixed $y |
||
129 | * |
||
130 | * @return bool |
||
131 | */ |
||
132 | public function getCompareDate($x, $operator, $y) |
||
136 | |||
137 | /** |
||
138 | * @param mixed $x |
||
139 | * @param string $operator |
||
140 | * @param mixed $y |
||
141 | * |
||
142 | * @return bool |
||
143 | */ |
||
144 | public function getCompareTime($x, $operator, $y) |
||
148 | |||
149 | /** |
||
150 | * @param mixed $x |
||
151 | * @param string $operator |
||
152 | * @param mixed $y |
||
153 | * |
||
154 | * @return bool |
||
155 | */ |
||
156 | public function getCompareWeek($x, $operator, $y) |
||
160 | |||
161 | /** |
||
162 | * @param mixed $x |
||
163 | * @param string $operator |
||
164 | * @param mixed $y |
||
165 | * |
||
166 | * @return bool |
||
167 | */ |
||
168 | public function getCompareMonth($x, $operator, $y) |
||
172 | |||
173 | /** |
||
174 | * @param mixed $x |
||
175 | * @param string $operator |
||
176 | * @param mixed $y |
||
177 | * |
||
178 | * @return bool |
||
179 | */ |
||
180 | public function getCompareYear($x, $operator, $y) |
||
184 | |||
185 | /** |
||
186 | * @param mixed $date |
||
187 | * |
||
188 | * @return \DateTime |
||
189 | */ |
||
190 | private function convert($date) |
||
194 | |||
195 | /** |
||
196 | * @return string |
||
197 | */ |
||
198 | public function getName() |
||
202 | } |
||
203 |