1 | <?php |
||
20 | class Standard |
||
21 | extends \Aimeos\Controller\Frontend\Base |
||
22 | implements Iface, \Aimeos\Controller\Frontend\Common\Iface |
||
23 | { |
||
24 | private $conditions = []; |
||
25 | private $filter; |
||
26 | private $manager; |
||
27 | private $sort; |
||
28 | |||
29 | |||
30 | /** |
||
31 | * Common initialization for controller classes. |
||
32 | * |
||
33 | * @param \Aimeos\MShop\Context\Item\Iface $context Common MShop context object |
||
34 | */ |
||
35 | public function __construct( \Aimeos\MShop\Context\Item\Iface $context ) |
||
61 | |||
62 | |||
63 | /** |
||
64 | * Returns the aggregated count of products for the given key. |
||
65 | * |
||
66 | * @param \Aimeos\MW\Criteria\Iface $filter Critera object which contains the filter conditions |
||
|
|||
67 | * @param string $key Search key to aggregate for, e.g. "index.attribute.id" |
||
68 | * @return array Associative list of key values as key and the product count for this key as value |
||
69 | * @since 2019.04 |
||
70 | */ |
||
71 | public function aggregate( $key ) |
||
76 | |||
77 | |||
78 | /** |
||
79 | * Adds attribute IDs for filtering where products must reference all IDs |
||
80 | * |
||
81 | * @param array|string $attrIds Attribute ID or list of IDs |
||
82 | * @return \Aimeos\Controller\Frontend\Product\Iface Product controller for fluent interface |
||
83 | * @since 2019.04 |
||
84 | */ |
||
85 | public function allOf( $attrIds ) |
||
95 | |||
96 | |||
97 | /** |
||
98 | * Adds catalog IDs for filtering |
||
99 | * |
||
100 | * @param array|string $catIds Catalog ID or list of IDs |
||
101 | * @param string $listtype List type of the products referenced by the categories |
||
102 | * @param integer $level Constant from \Aimeos\MW\Tree\Manager\Base if products in subcategories are matched too |
||
103 | * @return \Aimeos\Controller\Frontend\Product\Iface Product controller for fluent interface |
||
104 | * @since 2019.04 |
||
105 | */ |
||
106 | public function category( $catIds, $listtype = 'default', $level = \Aimeos\MW\Tree\Manager\Base::LEVEL_ONE ) |
||
135 | |||
136 | |||
137 | /** |
||
138 | * Adds generic condition for filtering products |
||
139 | * |
||
140 | * @param string $operator Comparison operator, e.g. "==", "!=", "<", "<=", ">=", ">", "=~", "~=" |
||
141 | * @param string $key Search key defined by the product manager, e.g. "product.status" |
||
142 | * @param array|string $value Value or list of values to compare to |
||
143 | * @return \Aimeos\Controller\Frontend\Product\Iface Product controller for fluent interface |
||
144 | * @since 2019.04 |
||
145 | */ |
||
146 | public function compare( $operator, $key, $value ) |
||
151 | |||
152 | |||
153 | /** |
||
154 | * Returns the product for the given product ID |
||
155 | * |
||
156 | * @param string $id Unique product ID |
||
157 | * @param string[] $domains Domain names of items that are associated with the products and that should be fetched too |
||
158 | * @return \Aimeos\MShop\Product\Item\Iface Product item including the referenced domains items |
||
159 | * @since 2019.04 |
||
160 | */ |
||
161 | public function get( $id, $domains = ['media', 'price', 'text'] ) |
||
165 | |||
166 | |||
167 | /** |
||
168 | * Returns the product for the given product code |
||
169 | * |
||
170 | * @param string $code Unique product code |
||
171 | * @param string[] $domains Domain names of items that are associated with the products and that should be fetched too |
||
172 | * @return \Aimeos\MShop\Product\Item\Iface Product item including the referenced domains items |
||
173 | * @since 2019.04 |
||
174 | */ |
||
175 | public function find( $code, $domains = ['media', 'price', 'text'] ) |
||
179 | |||
180 | |||
181 | /** |
||
182 | * Adds attribute IDs for filtering where products must reference at least one ID |
||
183 | * |
||
184 | * @param array|string $attrIds Attribute ID or list of IDs |
||
185 | * @return \Aimeos\Controller\Frontend\Product\Iface Product controller for fluent interface |
||
186 | * @since 2019.04 |
||
187 | */ |
||
188 | public function oneOf( $attrIds ) |
||
196 | |||
197 | |||
198 | /** |
||
199 | * Parses the given array and adds the conditions to the list of conditions |
||
200 | * |
||
201 | * @param array $conditions List of conditions, e.g. [['>' => ['product.status' => 0]], ['==' => ['product.type' => 'default']]] |
||
202 | * @return \Aimeos\Controller\Frontend\Product\Iface Product controller for fluent interface |
||
203 | * @since 2019.04 |
||
204 | */ |
||
205 | public function parse( array $conditions ) |
||
210 | |||
211 | |||
212 | /** |
||
213 | * Adds product IDs for filtering |
||
214 | * |
||
215 | * @param array|string $prodIds Product ID or list of IDs |
||
216 | * @return \Aimeos\Controller\Frontend\Product\Iface Product controller for fluent interface |
||
217 | * @since 2019.04 |
||
218 | */ |
||
219 | public function product( $prodIds ) |
||
227 | |||
228 | |||
229 | /** |
||
230 | * Returns the products filtered by the previously assigned conditions |
||
231 | * |
||
232 | * @param string[] $domains Domain names of items that are associated with the products and that should be fetched too |
||
233 | * @param integer &$total Parameter where the total number of found products will be stored in |
||
234 | * @return array Ordered list of product items implementing \Aimeos\MShop\Product\Item\Iface |
||
235 | * @since 2019.04 |
||
236 | */ |
||
237 | public function search( $domains = ['media', 'price', 'text'], &$total = null ) |
||
242 | |||
243 | |||
244 | /** |
||
245 | * Sets the start value and the number of returned products for slicing the list of found products |
||
246 | * |
||
247 | * @param integer $start Start value of the first product in the list |
||
248 | * @param integer $limit Number of returned products |
||
249 | * @return \Aimeos\Controller\Frontend\Product\Iface Product controller for fluent interface |
||
250 | * @since 2019.04 |
||
251 | */ |
||
252 | public function slice( $start, $limit ) |
||
257 | |||
258 | |||
259 | /** |
||
260 | * Sets the sorting of the product list |
||
261 | * |
||
262 | * @param string|null $sort Sortation of the product list like "name", "-name", "price", "-price", "code", "-code", "ctime, "-ctime" and "relevance", null for no sortation |
||
263 | * @return \Aimeos\Controller\Frontend\Product\Iface Product controller for fluent interface |
||
264 | * @since 2019.04 |
||
265 | */ |
||
266 | public function sort( $key = null ) |
||
317 | |||
318 | |||
319 | /** |
||
320 | * Adds supplier IDs for filtering |
||
321 | * |
||
322 | * @param array|string $supIds Supplier ID or list of IDs |
||
323 | * @param string $listtype List type of the products referenced by the suppliers |
||
324 | * @return \Aimeos\Controller\Frontend\Product\Iface Product controller for fluent interface |
||
325 | * @since 2019.04 |
||
326 | */ |
||
327 | public function supplier( $supIds, $listtype = 'default' ) |
||
342 | |||
343 | |||
344 | /** |
||
345 | * Adds input string for full text search |
||
346 | * |
||
347 | * @param string|null $text User input for full text search |
||
348 | * @return \Aimeos\Controller\Frontend\Product\Iface Product controller for fluent interface |
||
349 | * @since 2019.04 |
||
350 | */ |
||
351 | public function text( $text ) |
||
363 | |||
364 | |||
365 | /** |
||
366 | * Returns the list of catalog IDs for the given catalog tree |
||
367 | * |
||
368 | * @param \Aimeos\MShop\Catalog\Item\Iface $item Catalog item with children |
||
369 | * @return array List of catalog IDs |
||
370 | */ |
||
371 | protected function getCatalogIdsFromTree( \Aimeos\MShop\Catalog\Item\Iface $item ) |
||
385 | |||
386 | |||
387 | /** |
||
388 | * Validates the given IDs as integers |
||
389 | * |
||
390 | * @param array $ids List of IDs to validate |
||
391 | * @return array List of validated IDs |
||
392 | */ |
||
393 | protected function validateIds( array $ids ) |
||
406 | } |
||
407 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.