1 | <?php |
||
20 | class Standard |
||
21 | extends \Aimeos\Controller\Frontend\Base |
||
2 ignored issues
–
show
|
|||
22 | implements Iface, \Aimeos\Controller\Frontend\Common\Iface |
||
1 ignored issue
–
show
|
|||
23 | { |
||
24 | /** |
||
25 | * Returns the given search filter with the conditions attached for filtering by attribute. |
||
26 | * |
||
27 | * @param \Aimeos\MW\Criteria\Iface $filter Criteria object used for product search |
||
28 | * @param string|array $catid Selected category by the user |
||
29 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
||
30 | * @since 2017.03 |
||
31 | */ |
||
32 | public function addFilterAttribute( \Aimeos\MW\Criteria\Iface $filter, array $attrIds, array $optIds, array $oneIds ) |
||
73 | |||
74 | |||
75 | /** |
||
76 | * Returns the given search filter with the conditions attached for filtering by category. |
||
77 | * |
||
78 | * @param \Aimeos\MW\Criteria\Iface $filter Criteria object used for product search |
||
79 | * @param string|array $catId Selected category by the user |
||
80 | * @param integer $level Constant for current category only, categories of next level (LEVEL_LIST) or whole subtree (LEVEL_SUBTREE) |
||
81 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
||
82 | * @since 2017.03 |
||
83 | */ |
||
84 | public function addFilterCategory( \Aimeos\MW\Criteria\Iface $filter, $catId, |
||
119 | |||
120 | |||
121 | /** |
||
122 | * Returns the given search filter with the conditions attached for filtering by text. |
||
123 | * |
||
124 | * @param \Aimeos\MW\Criteria\Iface $filter Criteria object used for product search |
||
125 | * @param string $input Search string entered by the user |
||
126 | * @param string $listtype List type of the text associated to the product, usually "default" |
||
127 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
||
128 | * @since 2017.03 |
||
129 | */ |
||
130 | public function addFilterText( \Aimeos\MW\Criteria\Iface $filter, $input, $listtype = 'default' ) |
||
138 | |||
139 | |||
140 | /** |
||
141 | * Returns the aggregated count of products for the given key. |
||
142 | * |
||
143 | * @param \Aimeos\MW\Criteria\Iface $filter Critera object which contains the filter conditions |
||
144 | * @param string $key Search key to aggregate for, e.g. "index.attribute.id" |
||
145 | * @return array Associative list of key values as key and the product count for this key as value |
||
146 | * @since 2017.03 |
||
147 | */ |
||
148 | public function aggregate( \Aimeos\MW\Criteria\Iface $filter, $key ) |
||
152 | |||
153 | |||
154 | /** |
||
155 | * Returns the default index filter. |
||
156 | * |
||
157 | * @param string|null $sort Sortation of the product list like "name", "code", "price" and "position", null for no sortation |
||
158 | * @param string $direction Sort direction of the product list ("+", "-") |
||
159 | * @param integer $start Position in the list of found products where to begin retrieving the items |
||
160 | * @param integer $size Number of products that should be returned |
||
161 | * @param string $listtype Type of the product list, e.g. default, promotion, etc. |
||
162 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
||
163 | * @since 2017.03 |
||
164 | */ |
||
165 | public function createFilter( $sort = null, $direction = '+', $start = 0, $size = 100, $listtype = 'default' ) |
||
208 | |||
209 | |||
210 | /** |
||
211 | * Returns text filter for the given search string. |
||
212 | * |
||
213 | * @param string $input Search string entered by the user |
||
214 | * @param string|null $sort Sortation of the product list like "name" and "relevance", null for no sortation |
||
215 | * @param string $direction Sort direction of the product list ("asc", "desc") |
||
216 | * @param integer $start Position in the list of found products where to begin retrieving the items |
||
217 | * @param integer $size Number of products that should be returned |
||
218 | * @param string $listtype List type of the text associated to the product, usually "default" |
||
219 | * @param string $type Type of the text like "name", "short", "long", etc. |
||
220 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
||
221 | */ |
||
222 | public function createTextFilter( $input, $sort = null, $direction = '+', $start = 0, $size = 25, $listtype = 'default', $type = 'name' ) |
||
256 | |||
257 | |||
258 | /** |
||
259 | * Returns the products from the index filtered by the given criteria object. |
||
260 | * |
||
261 | * @param \Aimeos\MW\Criteria\Iface $filter Critera object which contains the filter conditions |
||
262 | * @param string[] $domains Domain names of items that are associated with the products and that should be fetched too |
||
263 | * @param integer &$total Parameter where the total number of found products will be stored in |
||
264 | * @return array Ordered list of product items implementing \Aimeos\MShop\Product\Item\Iface |
||
265 | * @since 2017.03 |
||
266 | */ |
||
267 | public function getItems( \Aimeos\MW\Criteria\Iface $filter, array $domains = array( 'media', 'price', 'text' ), &$total = null ) |
||
271 | |||
272 | |||
273 | /** |
||
274 | * Returns an list of product text strings matched by the filter. |
||
275 | * |
||
276 | * @param \Aimeos\MW\Criteria\Iface $filter Critera object which contains the filter conditions |
||
277 | * @return array Associative list of the product ID as key and the product text as value |
||
278 | */ |
||
279 | public function getTextList( \Aimeos\MW\Criteria\Iface $filter ) |
||
283 | |||
284 | |||
285 | /** |
||
286 | * Returns the list of catalog IDs for the given catalog tree |
||
287 | * |
||
288 | * @param \Aimeos\MShop\Catalog\Item\Iface $item Catalog item with children |
||
289 | * @return array List of catalog IDs |
||
290 | */ |
||
291 | protected function getCatalogIdsFromTree( \Aimeos\MShop\Catalog\Item\Iface $item ) |
||
301 | |||
302 | |||
303 | /** |
||
304 | * Validates the given IDs as integers |
||
305 | * |
||
306 | * @param array $ids List of IDs to validate |
||
307 | * @return array List of validated IDs |
||
308 | */ |
||
309 | protected function validateIds( array $ids ) |
||
322 | } |
||
323 |