| 1 | <?php |
||
| 20 | abstract class Base |
||
| 21 | extends \Aimeos\Controller\Frontend\Base |
||
|
2 ignored issues
–
show
|
|||
| 22 | implements \Aimeos\Controller\Frontend\Common\Decorator\Iface |
||
|
1 ignored issue
–
show
|
|||
| 23 | { |
||
| 24 | private $controller; |
||
| 25 | |||
| 26 | |||
| 27 | /** |
||
| 28 | * Initializes the controller decorator. |
||
| 29 | * |
||
| 30 | * @param \Aimeos\Controller\Frontend\Iface $controller Controller object |
||
| 31 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object with required objects |
||
| 32 | */ |
||
| 33 | public function __construct( \Aimeos\Controller\Frontend\Iface $controller, \Aimeos\MShop\Context\Item\Iface $context ) |
||
| 46 | |||
| 47 | |||
| 48 | /** |
||
| 49 | * Passes unknown methods to wrapped objects. |
||
| 50 | * |
||
| 51 | * @param string $name Name of the method |
||
| 52 | * @param array $param List of method parameter |
||
| 53 | * @return mixed Returns the value of the called method |
||
| 54 | * @throws \Aimeos\Controller\Frontend\Exception If method call failed |
||
| 55 | */ |
||
| 56 | public function __call( $name, array $param ) |
||
| 60 | |||
| 61 | |||
| 62 | /** |
||
| 63 | * Returns the given search filter with the conditions attached for filtering by attribute. |
||
| 64 | * |
||
| 65 | * @param \Aimeos\MW\Criteria\Iface $filter Criteria object used for product search |
||
| 66 | * @param array $attrIds List of attribute IDs for faceted search |
||
| 67 | * @param array $optIds List of OR-combined attribute IDs for faceted search |
||
| 68 | * @param array $attrIds Associative list of OR-combined attribute IDs per attribute type for faceted search |
||
| 69 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
||
| 70 | * @since 2017.03 |
||
| 71 | */ |
||
| 72 | public function addFilterAttribute( \Aimeos\MW\Criteria\Iface $filter, array $attrIds, array $optIds, array $oneIds ) |
||
| 76 | |||
| 77 | |||
| 78 | /** |
||
| 79 | * Returns the given search filter with the conditions attached for filtering by category. |
||
| 80 | * |
||
| 81 | * @param \Aimeos\MW\Criteria\Iface $filter Criteria object used for product search |
||
| 82 | * @param string|array $catId Selected category by the user |
||
| 83 | * @param integer $level Constant for current category only, categories of next level (LEVEL_LIST) or whole subtree (LEVEL_SUBTREE) |
||
| 84 | * @param string|null $sort Sortation of the product list like "name", "code", "price" and "position", null for no sortation |
||
| 85 | * @param string $direction Sort direction of the product list ("+", "-") |
||
| 86 | * @param string $listtype List type of the product associated to the category, usually "default" |
||
| 87 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
||
| 88 | * @since 2017.03 |
||
| 89 | */ |
||
| 90 | public function addFilterCategory( \Aimeos\MW\Criteria\Iface $filter, $catId, |
||
| 95 | |||
| 96 | |||
| 97 | /** |
||
| 98 | * Returns the given search filter with the conditions attached for filtering by text. |
||
| 99 | * |
||
| 100 | * @param \Aimeos\MW\Criteria\Iface $filter Criteria object used for product search |
||
| 101 | * @param string $input Search string entered by the user |
||
| 102 | * @param string|null $sort Sortation of the product list like "name", "code", "price" and "position", null for no sortation |
||
| 103 | * @param string $direction Sort direction of the product list ("+", "-") |
||
| 104 | * @param string $listtype List type of the text associated to the product, usually "default" |
||
| 105 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
||
| 106 | * @since 2017.03 |
||
| 107 | */ |
||
| 108 | public function addFilterText( \Aimeos\MW\Criteria\Iface $filter, $input, $sort = null, $direction = '+', $listtype = 'default' ) |
||
| 112 | |||
| 113 | |||
| 114 | /** |
||
| 115 | * Returns the aggregated count of products from the product for the given key. |
||
| 116 | * |
||
| 117 | * @param \Aimeos\MW\Criteria\Iface $filter Critera object which contains the filter conditions |
||
| 118 | * @param string $key Search key to aggregate for, e.g. "product.attribute.id" |
||
| 119 | * @return array Associative list of key values as key and the product count for this key as value |
||
| 120 | * @since 2015.08 |
||
| 121 | */ |
||
| 122 | public function aggregate( \Aimeos\MW\Criteria\Iface $filter, $key ) |
||
| 126 | |||
| 127 | |||
| 128 | /** |
||
| 129 | * Returns the default product filter. |
||
| 130 | * |
||
| 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 integer $start Position in the list of found products where to begin retrieving the items |
||
| 134 | * @param integer $size Number of products that should be returned |
||
| 135 | * @param string $listtype Type of the product list, e.g. default, promotion, etc. |
||
| 136 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
||
| 137 | * @since 2015.08 |
||
| 138 | */ |
||
| 139 | public function createFilter( $sort = null, $direction = '+', $start = 0, $size = 100, $listtype = 'default' ) |
||
| 143 | |||
| 144 | |||
| 145 | /** |
||
| 146 | * Returns the product for the given product ID from the product |
||
| 147 | * |
||
| 148 | * @param string $productId Unique product ID |
||
| 149 | * @param string[] $domains Domain names of items that are associated with the products and that should be fetched too |
||
| 150 | * @return \Aimeos\MShop\Product\Item\Iface Product item including the referenced domains items |
||
| 151 | * @since 2017.03 |
||
| 152 | */ |
||
| 153 | public function getItem( $productId, array $domains = array( 'attribute', 'media', 'price', 'product', 'product/property', 'text' ) ) |
||
| 157 | |||
| 158 | |||
| 159 | /** |
||
| 160 | * Returns the product for the given product ID from the product |
||
| 161 | * |
||
| 162 | * @param string[] $productIds List of unique product ID |
||
| 163 | * @param string[] $domains Domain names of items that are associated with the products and that should be fetched too |
||
| 164 | * @return \Aimeos\MShop\Product\Item\Iface[] Associative list of product IDs as keys and product items as values |
||
| 165 | * @since 2017.03 |
||
| 166 | */ |
||
| 167 | public function getItems( array $productIds, array $domains = array( 'media', 'price', 'text' ) ) |
||
| 171 | |||
| 172 | |||
| 173 | /** |
||
| 174 | * Returns the products from the product filtered by the given criteria object. |
||
| 175 | * |
||
| 176 | * @param \Aimeos\MW\Criteria\Iface $filter Critera object which contains the filter conditions |
||
| 177 | * @param string[] $domains Domain names of items that are associated with the products and that should be fetched too |
||
| 178 | * @param integer &$total Parameter where the total number of found products will be stored in |
||
| 179 | * @return array Ordered list of product items implementing \Aimeos\MShop\Product\Item\Iface |
||
| 180 | * @since 2015.08 |
||
| 181 | */ |
||
| 182 | public function searchItems( \Aimeos\MW\Criteria\Iface $filter, array $domains = array( 'media', 'price', 'text' ), &$total = null ) |
||
| 186 | |||
| 187 | |||
| 188 | /** |
||
| 189 | * Returns the frontend controller |
||
| 190 | * |
||
| 191 | * @return \Aimeos\Controller\Frontend\Product\Iface Frontend controller object |
||
| 192 | */ |
||
| 193 | protected function getController() |
||
| 197 | } |
||
| 198 |