1 | <?php |
||
20 | class Standard |
||
21 | extends \Aimeos\Controller\Frontend\Base |
||
22 | implements Iface, \Aimeos\Controller\Frontend\Common\Iface |
||
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 array $attrIds List of attribute IDs for faceted search |
||
29 | * @param array $optIds List of OR-combined attribute IDs for faceted search |
||
30 | * @param array $attrIds Associative list of OR-combined attribute IDs per attribute type for faceted search |
||
31 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
||
32 | * @since 2017.03 |
||
33 | */ |
||
34 | public function addFilterAttribute( \Aimeos\MW\Criteria\Iface $filter, array $attrIds, array $optIds, array $oneIds ) |
||
75 | |||
76 | |||
77 | /** |
||
78 | * Returns the given search filter with the conditions attached for filtering by category. |
||
79 | * |
||
80 | * @param \Aimeos\MW\Criteria\Iface $filter Criteria object used for product search |
||
81 | * @param string|array $catId Selected category by the user |
||
82 | * @param integer $level Constant for current category only, categories of next level (LEVEL_LIST) or whole subtree (LEVEL_SUBTREE) |
||
83 | * @param string|null $sort Sortation of the product list like "name", "code", "price" and "position", null for no sortation |
||
84 | * @param string $direction Sort direction of the product list ("+", "-") |
||
85 | * @param string $listtype List type of the product associated to the category, usually "default" |
||
86 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
||
87 | * @since 2017.03 |
||
88 | */ |
||
89 | public function addFilterCategory( \Aimeos\MW\Criteria\Iface $filter, $catId, |
||
124 | |||
125 | |||
126 | /** |
||
127 | * Returns the given search filter with the conditions attached for filtering by text. |
||
128 | * |
||
129 | * @param \Aimeos\MW\Criteria\Iface $filter Criteria object used for product search |
||
130 | * @param string $input Search string entered by the user |
||
131 | * @param string|null $sort Sortation of the product list like "name", "code", "price" and "position", null for no sortation |
||
132 | * @param string $direction Sort direction of the product list ("+", "-") |
||
133 | * @param string $listtype List type of the text associated to the product, usually "default" |
||
134 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
||
135 | * @since 2017.03 |
||
136 | */ |
||
137 | public function addFilterText( \Aimeos\MW\Criteria\Iface $filter, $input, $sort = null, $direction = '+', $listtype = 'default' ) |
||
145 | |||
146 | |||
147 | /** |
||
148 | * Returns the aggregated count of products for the given key. |
||
149 | * |
||
150 | * @param \Aimeos\MW\Criteria\Iface $filter Critera object which contains the filter conditions |
||
151 | * @param string $key Search key to aggregate for, e.g. "index.attribute.id" |
||
152 | * @return array Associative list of key values as key and the product count for this key as value |
||
153 | * @since 2017.03 |
||
154 | */ |
||
155 | public function aggregate( \Aimeos\MW\Criteria\Iface $filter, $key ) |
||
159 | |||
160 | |||
161 | /** |
||
162 | * Returns the default product filter. |
||
163 | * |
||
164 | * @param string|null $sort Sortation of the product list like "name", "code", "price" and "position", null for no sortation |
||
165 | * @param string $direction Sort direction of the product list ("+", "-") |
||
166 | * @param integer $start Position in the list of found products where to begin retrieving the items |
||
167 | * @param integer $size Number of products that should be returned |
||
168 | * @param string $listtype Type of the product list, e.g. default, promotion, etc. |
||
169 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
||
170 | * @since 2017.03 |
||
171 | */ |
||
172 | public function createFilter( $sort = null, $direction = '+', $start = 0, $size = 100, $listtype = 'default' ) |
||
227 | |||
228 | |||
229 | /** |
||
230 | * Returns the product for the given product ID from the product |
||
231 | * |
||
232 | * @param string $productId Unique product ID |
||
233 | * @param string[] $domains Domain names of items that are associated with the products and that should be fetched too |
||
234 | * @return \Aimeos\MShop\Product\Item\Iface Product item including the referenced domains items |
||
235 | * @since 2017.03 |
||
236 | */ |
||
237 | public function getItem( $productId, array $domains = array( 'attribute', 'media', 'price', 'product', 'product/property', 'text' ) ) |
||
247 | |||
248 | |||
249 | /** |
||
250 | * Returns the product for the given product ID from the product |
||
251 | * |
||
252 | * @param string[] $productIds List of unique product ID |
||
253 | * @param string[] $domains Domain names of items that are associated with the products and that should be fetched too |
||
254 | * @return \Aimeos\MShop\Product\Item\Iface[] Associative list of product IDs as keys and product items as values |
||
255 | * @since 2017.03 |
||
256 | */ |
||
257 | public function getItems( array $productIds, array $domains = array( 'media', 'price', 'text' ) ) |
||
293 | |||
294 | |||
295 | /** |
||
296 | * Returns the products from the product filtered by the given criteria object. |
||
297 | * |
||
298 | * @param \Aimeos\MW\Criteria\Iface $filter Critera object which contains the filter conditions |
||
299 | * @param string[] $domains Domain names of items that are associated with the products and that should be fetched too |
||
300 | * @param integer &$total Parameter where the total number of found products will be stored in |
||
301 | * @return array Ordered list of product items implementing \Aimeos\MShop\Product\Item\Iface |
||
302 | * @since 2017.03 |
||
303 | */ |
||
304 | public function searchItems( \Aimeos\MW\Criteria\Iface $filter, array $domains = array( 'media', 'price', 'text' ), &$total = null ) |
||
308 | |||
309 | |||
310 | /** |
||
311 | * Returns the list of catalog IDs for the given catalog tree |
||
312 | * |
||
313 | * @param \Aimeos\MShop\Catalog\Item\Iface $item Catalog item with children |
||
314 | * @return array List of catalog IDs |
||
315 | */ |
||
316 | protected function getCatalogIdsFromTree( \Aimeos\MShop\Catalog\Item\Iface $item ) |
||
326 | |||
327 | |||
328 | /** |
||
329 | * Validates the given IDs as integers |
||
330 | * |
||
331 | * @param array $ids List of IDs to validate |
||
332 | * @return array List of validated IDs |
||
333 | */ |
||
334 | protected function validateIds( array $ids ) |
||
347 | } |
||
348 |