1 | <?php |
||
20 | class Standard |
||
21 | extends \Aimeos\Controller\Frontend\Base |
||
22 | implements Iface, \Aimeos\Controller\Frontend\Common\Iface |
||
23 | { |
||
24 | private $conditions = []; |
||
25 | private $filter; |
||
26 | private $manager; |
||
27 | |||
28 | |||
29 | /** |
||
30 | * Common initialization for controller classes |
||
31 | * |
||
32 | * @param \Aimeos\MShop\Context\Item\Iface $context Common MShop context object |
||
33 | */ |
||
34 | public function __construct( \Aimeos\MShop\Context\Item\Iface $context ) |
||
42 | |||
43 | |||
44 | /** |
||
45 | * Clones objects in controller and resets values |
||
46 | */ |
||
47 | public function __clone() |
||
51 | |||
52 | |||
53 | /** |
||
54 | * Adds the SKUs of the products for filtering |
||
55 | * |
||
56 | * @param array|string $codes Codes of the products |
||
57 | * @return \Aimeos\Controller\Frontend\Stock\Iface Stock controller for fluent interface |
||
58 | * @since 2019.04 |
||
59 | */ |
||
60 | public function code( $codes ) |
||
68 | |||
69 | |||
70 | /** |
||
71 | * Adds generic condition for filtering |
||
72 | * |
||
73 | * @param string $operator Comparison operator, e.g. "==", "!=", "<", "<=", ">=", ">", "=~", "~=" |
||
74 | * @param string $key Search key defined by the stock manager, e.g. "stock.dateback" |
||
75 | * @param array|string $value Value or list of values to compare to |
||
76 | * @return \Aimeos\Controller\Frontend\Stock\Iface Stock controller for fluent interface |
||
77 | * @since 2019.04 |
||
78 | */ |
||
79 | public function compare( $operator, $key, $value ) |
||
84 | |||
85 | |||
86 | /** |
||
87 | * Returns the stock item for the given stock ID |
||
88 | * |
||
89 | * @param string $id Unique stock ID |
||
90 | * @return \Aimeos\MShop\Stock\Item\Iface Stock item |
||
91 | * @since 2019.04 |
||
92 | */ |
||
93 | public function get( $id ) |
||
97 | |||
98 | |||
99 | /** |
||
100 | * Returns the stock item for the given SKU and type |
||
101 | * |
||
102 | * @param string $code Unique stock code |
||
103 | * @param string $type Type assigned to the stock item |
||
104 | * @return \Aimeos\MShop\Stock\Item\Iface Stock item |
||
105 | * @since 2019.04 |
||
106 | */ |
||
107 | public function find( $code, $type ) |
||
111 | |||
112 | |||
113 | /** |
||
114 | * Parses the given array and adds the conditions to the list of conditions |
||
115 | * |
||
116 | * @param array $conditions List of conditions, e.g. ['>' => ['stock.dateback' => '2000-01-01 00:00:00']] |
||
117 | * @return \Aimeos\Controller\Frontend\Stock\Iface Stock controller for fluent interface |
||
118 | * @since 2019.04 |
||
119 | */ |
||
120 | public function parse( array $conditions ) |
||
125 | |||
126 | |||
127 | /** |
||
128 | * Returns the stock items filtered by the previously assigned conditions |
||
129 | * |
||
130 | * @param integer &$total Parameter where the total number of found stock items will be stored in |
||
131 | * @return \Aimeos\MShop\Stock\Item\Iface[] Ordered list of stock items |
||
132 | * @since 2019.04 |
||
133 | */ |
||
134 | public function search( &$total = null ) |
||
139 | |||
140 | |||
141 | /** |
||
142 | * Sets the start value and the number of returned stock items for slicing the list of found stock items |
||
143 | * |
||
144 | * @param integer $start Start value of the first stock item in the list |
||
145 | * @param integer $limit Number of returned stock items |
||
146 | * @return \Aimeos\Controller\Frontend\Stock\Iface Stock controller for fluent interface |
||
147 | * @since 2019.04 |
||
148 | */ |
||
149 | public function slice( $start, $limit ) |
||
154 | |||
155 | |||
156 | /** |
||
157 | * Sets the sorting of the result list |
||
158 | * |
||
159 | * @param string|null $key Sorting of the result list like "stock.type", null for no sorting |
||
160 | * @return \Aimeos\Controller\Frontend\Stock\Iface Stock controller for fluent interface |
||
161 | * @since 2019.04 |
||
162 | */ |
||
163 | public function sort( $key = null ) |
||
190 | |||
191 | |||
192 | /** |
||
193 | * Adds stock types for filtering |
||
194 | * |
||
195 | * @param array|string $types Stock type codes |
||
196 | * @return \Aimeos\Controller\Frontend\Stock\Iface Stock controller for fluent interface |
||
197 | * @since 2019.04 |
||
198 | */ |
||
199 | public function type( $types ) |
||
207 | } |
||
208 |