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 | * Cancels an active subscription |
||
55 | * |
||
56 | * @param string $id Unique subscription ID |
||
57 | * @return \Aimeos\MShop\Subscription\Item\Iface Canceled subscription item |
||
58 | */ |
||
59 | public function cancel( $id ) |
||
67 | |||
68 | |||
69 | /** |
||
70 | * Adds generic condition for filtering |
||
71 | * |
||
72 | * @param string $operator Comparison operator, e.g. "==", "!=", "<", "<=", ">=", ">", "=~", "~=" |
||
73 | * @param string $key Search key defined by the subscription manager, e.g. "subscription.status" |
||
74 | * @param array|string $value Value or list of values to compare to |
||
75 | * @return \Aimeos\Controller\Frontend\Subscription\Iface Subscription controller for fluent interface |
||
76 | * @since 2019.04 |
||
77 | */ |
||
78 | public function compare( $operator, $key, $value ) |
||
83 | |||
84 | |||
85 | /** |
||
86 | * Returns the subscription item for the given ID |
||
87 | * |
||
88 | * @param string $id Unique subscription ID |
||
89 | * @return \Aimeos\MShop\Subscription\Item\Iface Subscription object |
||
90 | */ |
||
91 | public function get( $id ) |
||
113 | |||
114 | |||
115 | /** |
||
116 | * Returns the available interval attribute items |
||
117 | * |
||
118 | * @return \Aimeos\MShop\Attribute\Item\Iface[] Associative list of intervals as keys and interval attribute items as values |
||
119 | */ |
||
120 | public function getIntervals() |
||
141 | |||
142 | |||
143 | /** |
||
144 | * Parses the given array and adds the conditions to the list of conditions |
||
145 | * |
||
146 | * @param array $conditions List of conditions, e.g. ['>' => ['subscription.interval' => 'P0Y1M0W0D']] |
||
147 | * @return \Aimeos\Controller\Frontend\Subscription\Iface Subscription controller for fluent interface |
||
148 | * @since 2019.04 |
||
149 | */ |
||
150 | public function parse( array $conditions ) |
||
155 | |||
156 | |||
157 | /** |
||
158 | * Saves the modified subscription item |
||
159 | * |
||
160 | * @param \Aimeos\MShop\Subscription\Item\Iface $item Subscription object |
||
161 | * @return \Aimeos\MShop\Subscription\Item\Iface Saved subscription item |
||
162 | */ |
||
163 | public function save( \Aimeos\MShop\Subscription\Item\Iface $item ) |
||
167 | |||
168 | /** |
||
169 | * Returns the subscriptions filtered by the previously assigned conditions |
||
170 | * |
||
171 | * @param integer &$total Parameter where the total number of found subscriptions will be stored in |
||
172 | * @return \Aimeos\MShop\Subscription\Item\Iface[] Ordered list of subscription items |
||
173 | * @since 2019.04 |
||
174 | */ |
||
175 | public function search( &$total = null ) |
||
180 | |||
181 | |||
182 | /** |
||
183 | * Sets the start value and the number of returned subscription items for slicing the list of found subscription items |
||
184 | * |
||
185 | * @param integer $start Start value of the first subscription item in the list |
||
186 | * @param integer $limit Number of returned subscription items |
||
187 | * @return \Aimeos\Controller\Frontend\Subscription\Iface Subscription controller for fluent interface |
||
188 | * @since 2019.04 |
||
189 | */ |
||
190 | public function slice( $start, $limit ) |
||
195 | |||
196 | |||
197 | /** |
||
198 | * Sets the sorting of the result list |
||
199 | * |
||
200 | * @param string|null $key Sorting key of the result list like "interval", null for no sorting |
||
201 | * @return \Aimeos\Controller\Frontend\Subscription\Iface Subscription controller for fluent interface |
||
202 | * @since 2019.04 |
||
203 | */ |
||
204 | public function sort( $key = null ) |
||
228 | } |
||
229 |