| 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 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 index 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' ) |
||
| 215 | |||
| 216 | |||
| 217 | /** |
||
| 218 | * Returns the product for the given product ID from the index |
||
| 219 | * |
||
| 220 | * @param string $productId Unique product ID |
||
| 221 | * @param string[] $domains Domain names of items that are associated with the products and that should be fetched too |
||
| 222 | * @return \Aimeos\MShop\Product\Item\Iface Product item including the referenced domains items |
||
| 223 | * @since 2017.03 |
||
| 224 | */ |
||
| 225 | public function getItem( $productId, array $domains = array( 'attribute', 'media', 'price', 'product', 'product/property', 'text' ) ) |
||
| 229 | |||
| 230 | |||
| 231 | /** |
||
| 232 | * Returns the product for the given product ID from the index |
||
| 233 | * |
||
| 234 | * @param string[] $productIds List of unique product ID |
||
| 235 | * @param string[] $domains Domain names of items that are associated with the products and that should be fetched too |
||
| 236 | * @return \Aimeos\MShop\Product\Item\Iface[] Associative list of product IDs as keys and product items as values |
||
| 237 | * @since 2017.03 |
||
| 238 | */ |
||
| 239 | public function getItems( array $productIds, array $domains = array( 'media', 'price', 'text' ) ) |
||
| 253 | |||
| 254 | |||
| 255 | /** |
||
| 256 | * Returns the products from the index filtered by the given criteria object. |
||
| 257 | * |
||
| 258 | * @param \Aimeos\MW\Criteria\Iface $filter Critera object which contains the filter conditions |
||
| 259 | * @param string[] $domains Domain names of items that are associated with the products and that should be fetched too |
||
| 260 | * @param integer &$total Parameter where the total number of found products will be stored in |
||
| 261 | * @return array Ordered list of product items implementing \Aimeos\MShop\Product\Item\Iface |
||
| 262 | * @since 2017.03 |
||
| 263 | */ |
||
| 264 | public function searchItems( \Aimeos\MW\Criteria\Iface $filter, array $domains = array( 'media', 'price', 'text' ), &$total = null ) |
||
| 268 | |||
| 269 | |||
| 270 | /** |
||
| 271 | * Returns the list of catalog IDs for the given catalog tree |
||
| 272 | * |
||
| 273 | * @param \Aimeos\MShop\Catalog\Item\Iface $item Catalog item with children |
||
| 274 | * @return array List of catalog IDs |
||
| 275 | */ |
||
| 276 | protected function getCatalogIdsFromTree( \Aimeos\MShop\Catalog\Item\Iface $item ) |
||
| 286 | |||
| 287 | |||
| 288 | /** |
||
| 289 | * Validates the given IDs as integers |
||
| 290 | * |
||
| 291 | * @param array $ids List of IDs to validate |
||
| 292 | * @return array List of validated IDs |
||
| 293 | */ |
||
| 294 | protected function validateIds( array $ids ) |
||
| 307 | } |
||
| 308 |