| 1 | <?php |
||
| 21 | class Standard |
||
| 22 | extends \Aimeos\Controller\Frontend\Base |
||
|
2 ignored issues
–
show
|
|||
| 23 | implements Iface, \Aimeos\Controller\Frontend\Common\Iface |
||
|
1 ignored issue
–
show
|
|||
| 24 | { |
||
| 25 | /** |
||
| 26 | * Returns the manager for the given name |
||
| 27 | * |
||
| 28 | * @param string $name Name of the manager |
||
| 29 | * @return \Aimeos\MShop\Common\Manager\Iface Manager object |
||
| 30 | * @since 2015.08 |
||
| 31 | */ |
||
| 32 | public function createManager( $name ) |
||
| 36 | |||
| 37 | |||
| 38 | /** |
||
| 39 | * Returns the default catalog filter |
||
| 40 | * |
||
| 41 | * @param boolean True to add default criteria, e.g. status > 0 |
||
| 42 | * @return \Aimeos\MW\Criteria\Iface Criteria object for filtering |
||
| 43 | * @since 2017.03 |
||
| 44 | */ |
||
| 45 | public function createFilter( $default = true ) |
||
| 49 | |||
| 50 | |||
| 51 | /** |
||
| 52 | * Returns the list of categries that are in the path to the root node including the one specified by its ID. |
||
| 53 | * |
||
| 54 | * @param integer $id Category ID to start from, null for root node |
||
| 55 | * @param string[] $domains Domain names of items that are associated with the categories and that should be fetched too |
||
| 56 | * @return array Associative list of items implementing \Aimeos\MShop\Catalog\Item\Iface with their IDs as keys |
||
| 57 | * @since 2017.03 |
||
| 58 | */ |
||
| 59 | public function getPath( $id, array $domains = array( 'text', 'media' ) ) |
||
| 63 | |||
| 64 | |||
| 65 | /** |
||
| 66 | * Returns the hierarchical catalog tree starting from the given ID. |
||
| 67 | * |
||
| 68 | * @param integer|null $id Category ID to start from, null for root node |
||
| 69 | * @param string[] $domains Domain names of items that are associated with the categories and that should be fetched too |
||
| 70 | * @param integer $level Constant from \Aimeos\MW\Tree\Manager\Base for the depth of the returned tree, LEVEL_ONE for |
||
| 71 | * specific node only, LEVEL_LIST for node and all direct child nodes, LEVEL_TREE for the whole tree |
||
| 72 | * @param \Aimeos\MW\Criteria\Iface|null $search Optional criteria object with conditions |
||
| 73 | * @return \Aimeos\MShop\Catalog\Item\Iface Catalog node, maybe with children depending on the level constant |
||
| 74 | * @since 2017.03 |
||
| 75 | */ |
||
| 76 | public function getTree( $id = null, array $domains = array( 'text', 'media' ), |
||
| 81 | |||
| 82 | |||
| 83 | /** |
||
| 84 | * Returns the default catalog filter |
||
| 85 | * |
||
| 86 | * @param boolean True to add default criteria, e.g. status > 0 |
||
| 87 | * @return \Aimeos\MW\Criteria\Iface Criteria object for filtering |
||
| 88 | * @since 2015.08 |
||
| 89 | * @deprecated Use createFilter() instead |
||
| 90 | */ |
||
| 91 | public function createCatalogFilter( $default = true ) |
||
| 95 | |||
| 96 | |||
| 97 | /** |
||
| 98 | * Returns the list of categries that are in the path to the root node including the one specified by its ID. |
||
| 99 | * |
||
| 100 | * @param integer $id Category ID to start from, null for root node |
||
| 101 | * @param string[] $domains Domain names of items that are associated with the categories and that should be fetched too |
||
| 102 | * @return array Associative list of items implementing \Aimeos\MShop\Catalog\Item\Iface with their IDs as keys |
||
| 103 | * @since 2015.08 |
||
| 104 | * @deprecated Use getPath() instead |
||
| 105 | */ |
||
| 106 | public function getCatalogPath( $id, array $domains = array( 'text', 'media' ) ) |
||
| 110 | |||
| 111 | |||
| 112 | /** |
||
| 113 | * Returns the hierarchical catalog tree starting from the given ID. |
||
| 114 | * |
||
| 115 | * @param integer|null $id Category ID to start from, null for root node |
||
| 116 | * @param string[] $domains Domain names of items that are associated with the categories and that should be fetched too |
||
| 117 | * @param integer $level Constant from \Aimeos\MW\Tree\Manager\Base for the depth of the returned tree, LEVEL_ONE for |
||
| 118 | * specific node only, LEVEL_LIST for node and all direct child nodes, LEVEL_TREE for the whole tree |
||
| 119 | * @param \Aimeos\MW\Criteria\Iface|null $search Optional criteria object with conditions |
||
| 120 | * @return \Aimeos\MShop\Catalog\Item\Iface Catalog node, maybe with children depending on the level constant |
||
| 121 | * @since 2015.08 |
||
| 122 | * @deprecated Use getTree() instead |
||
| 123 | */ |
||
| 124 | public function getCatalogTree( $id = null, array $domains = array( 'text', 'media' ), |
||
| 129 | |||
| 130 | |||
| 131 | /** |
||
| 132 | * Returns the product item for the given ID if it's available |
||
| 133 | * |
||
| 134 | * @param array $ids List of product IDs |
||
| 135 | * @param array $domains Domain names of items that are associated with the products and that should be fetched too |
||
| 136 | * @return string[] List of product items implementing \Aimeos\MShop\Product\Item\Iface |
||
| 137 | * @throws \Aimeos\Controller\Frontend\Catalog\Exception If product isn't available |
||
| 138 | * @since 2015.08 |
||
| 139 | * @deprecated Use getItems() method in index controller instead |
||
| 140 | */ |
||
| 141 | public function getProductItems( array $ids, array $domains = array( 'media', 'price', 'text' ) ) |
||
| 146 | |||
| 147 | |||
| 148 | /** |
||
| 149 | * Returns the aggregated count of products for the given key. |
||
| 150 | * |
||
| 151 | * @param \Aimeos\MW\Criteria\Iface $filter Critera object which contains the filter conditions |
||
| 152 | * @param string $key Search key to aggregate for, e.g. "index.attribute.id" |
||
| 153 | * @return array Associative list of key values as key and the product count for this key as value |
||
| 154 | * @since 2015.08 |
||
| 155 | * @deprecated Use method in index controller instead |
||
| 156 | */ |
||
| 157 | public function aggregateIndex( \Aimeos\MW\Criteria\Iface $filter, $key ) |
||
| 162 | |||
| 163 | |||
| 164 | /** |
||
| 165 | * Returns the default index filter. |
||
| 166 | * |
||
| 167 | * @param string|null $sort Sortation of the product list like "name", "code", "price" and "position", null for no sortation |
||
| 168 | * @param string $direction Sort direction of the product list ("+", "-") |
||
| 169 | * @param integer $start Position in the list of found products where to begin retrieving the items |
||
| 170 | * @param integer $size Number of products that should be returned |
||
| 171 | * @param string $listtype Type of the product list, e.g. default, promotion, etc. |
||
| 172 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
||
| 173 | * @since 2015.08 |
||
| 174 | * @deprecated Use method in index controller instead |
||
| 175 | */ |
||
| 176 | public function createIndexFilter( $sort = null, $direction = '+', $start = 0, $size = 100, $listtype = 'default' ) |
||
| 181 | |||
| 182 | |||
| 183 | /** |
||
| 184 | * Returns the index filter for the given category ID. |
||
| 185 | * |
||
| 186 | * @param integer $catid ID of the category to get the product list from |
||
| 187 | * @param string|null $sort Sortation of the product list like "name", "code", "price" and "position", null for no sortation |
||
| 188 | * @param string $direction Sort direction of the product list ("+", "-") |
||
| 189 | * @param integer $start Position in the list of found products where to begin retrieving the items |
||
| 190 | * @param integer $size Number of products that should be returned |
||
| 191 | * @param string $listtype Type of the product list, e.g. default, promotion, etc. |
||
| 192 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
||
| 193 | * @since 2015.08 |
||
| 194 | * @deprecated Use createIndexFilter() and addIndexFilterCategory() instead |
||
| 195 | */ |
||
| 196 | public function createIndexFilterCategory( $catid, $sort = null, $direction = '+', $start = 0, $size = 100, $listtype = 'default' ) |
||
| 205 | |||
| 206 | |||
| 207 | /** |
||
| 208 | * Returns the index filter for the given search string. |
||
| 209 | * |
||
| 210 | * @param string $input Search string entered by the user |
||
| 211 | * @param string|null $sort Sortation of the product list like "name", "price" and "relevance", null for no sortation |
||
| 212 | * @param string $direction Sort direction of the product list ("+", "-") |
||
| 213 | * @param integer $start Position in the list of found products where to begin retrieving the items |
||
| 214 | * @param integer $size Number of products that should be returned |
||
| 215 | * @param string $listtype List type of the text associated to the product, usually "default" |
||
| 216 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
||
| 217 | * @since 2015.08 |
||
| 218 | * @deprecated Use createIndexFilter() and addIndexFilterText() instead |
||
| 219 | */ |
||
| 220 | public function createIndexFilterText( $input, $sort = null, $direction = '+', $start = 0, $size = 100, $listtype = 'default' ) |
||
| 229 | |||
| 230 | |||
| 231 | /** |
||
| 232 | * Returns the given search filter with the conditions attached for filtering by category. |
||
| 233 | * |
||
| 234 | * @param \Aimeos\MW\Criteria\Iface $search Criteria object used for product search |
||
| 235 | * @param string $catid Selected category by the user |
||
| 236 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
||
| 237 | * @since 2015.08 |
||
| 238 | * @deprecated Use method in index controller instead |
||
| 239 | */ |
||
| 240 | public function addIndexFilterCategory( \Aimeos\MW\Criteria\Iface $search, $catid ) |
||
| 245 | |||
| 246 | |||
| 247 | /** |
||
| 248 | * Returns the given search filter with the conditions attached for filtering by text. |
||
| 249 | * |
||
| 250 | * @param \Aimeos\MW\Criteria\Iface $search Criteria object used for product search |
||
| 251 | * @param string $input Search string entered by the user |
||
| 252 | * @param string $listtype List type of the text associated to the product, usually "default" |
||
| 253 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
||
| 254 | * @since 2015.08 |
||
| 255 | * @deprecated Use method in index controller instead |
||
| 256 | */ |
||
| 257 | public function addIndexFilterText( \Aimeos\MW\Criteria\Iface $search, $input, $listtype = 'default' ) |
||
| 262 | |||
| 263 | |||
| 264 | /** |
||
| 265 | * Returns the products from the index filtered by the given criteria object. |
||
| 266 | * |
||
| 267 | * @param \Aimeos\MW\Criteria\Iface $filter Critera object which contains the filter conditions |
||
| 268 | * @param string[] $domains Domain names of items that are associated with the products and that should be fetched too |
||
| 269 | * @param integer &$total Parameter where the total number of found products will be stored in |
||
| 270 | * @return array Ordered list of product items implementing \Aimeos\MShop\Product\Item\Iface |
||
| 271 | * @since 2015.08 |
||
| 272 | * @deprecated Use method in index controller instead |
||
| 273 | */ |
||
| 274 | public function getIndexItems( \Aimeos\MW\Criteria\Iface $filter, array $domains = array( 'media', 'price', 'text' ), &$total = null ) |
||
| 279 | |||
| 280 | |||
| 281 | /** |
||
| 282 | * Returns text filter for the given search string. |
||
| 283 | * |
||
| 284 | * @param string $input Search string entered by the user |
||
| 285 | * @param string|null $sort Sortation of the product list like "name" and "relevance", null for no sortation |
||
| 286 | * @param string $direction Sort direction of the product list ("asc", "desc") |
||
| 287 | * @param integer $start Position in the list of found products where to begin retrieving the items |
||
| 288 | * @param integer $size Number of products that should be returned |
||
| 289 | * @param string $listtype List type of the text associated to the product, usually "default" |
||
| 290 | * @param string $type Type of the text like "name", "short", "long", etc. |
||
| 291 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
||
| 292 | * @deprecated Use createFilter() method in index controller instead |
||
| 293 | */ |
||
| 294 | public function createTextFilter( $input, $sort = null, $direction = '+', $start = 0, $size = 25, $listtype = 'default', $type = 'name' ) |
||
| 328 | |||
| 329 | |||
| 330 | /** |
||
| 331 | * Returns an list of product text strings matched by the filter. |
||
| 332 | * |
||
| 333 | * @param \Aimeos\MW\Criteria\Iface $filter Critera object which contains the filter conditions |
||
| 334 | * @return array Associative list of the product ID as key and the product text as value |
||
| 335 | * @deprecated Use searchItems() method in index controller to retrieve product items instead |
||
| 336 | */ |
||
| 337 | public function getTextList( \Aimeos\MW\Criteria\Iface $filter ) |
||
| 341 | } |
||
| 342 |