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 generic condition for filtering |
||
55 | * |
||
56 | * @param string $operator Comparison operator, e.g. "==", "!=", "<", "<=", ">=", ">", "=~", "~=" |
||
57 | * @param string $key Search key defined by the supplier manager, e.g. "supplier.status" |
||
58 | * @param array|string $value Value or list of values to compare to |
||
59 | * @return \Aimeos\Controller\Frontend\Supplier\Iface Supplier controller for fluent interface |
||
60 | * @since 2019.04 |
||
61 | */ |
||
62 | public function compare( $operator, $key, $value ) |
||
67 | |||
68 | |||
69 | /** |
||
70 | * Returns the supplier for the given supplier ID |
||
71 | * |
||
72 | * @param string $id Unique supplier ID |
||
73 | * @param string[] $domains Domain names of items that are associated with the suppliers and that should be fetched too |
||
74 | * @return \Aimeos\MShop\Supplier\Item\Iface Supplier item including the referenced domains items |
||
75 | * @since 2019.04 |
||
76 | */ |
||
77 | public function get( $id, $domains = ['media', 'text'] ) |
||
81 | |||
82 | |||
83 | /** |
||
84 | * Returns the supplier for the given supplier code |
||
85 | * |
||
86 | * @param string $code Unique supplier code |
||
87 | * @param string[] $domains Domain names of items that are associated with the suppliers and that should be fetched too |
||
88 | * @return \Aimeos\MShop\Supplier\Item\Iface Supplier item including the referenced domains items |
||
89 | * @since 2019.04 |
||
90 | */ |
||
91 | public function find( $code, $domains = ['media', 'text'] ) |
||
95 | |||
96 | |||
97 | /** |
||
98 | * Parses the given array and adds the conditions to the list of conditions |
||
99 | * |
||
100 | * @param array $conditions List of conditions, e.g. ['=~' => ['supplier.label' => 'test']] |
||
101 | * @return \Aimeos\Controller\Frontend\Supplier\Iface Supplier controller for fluent interface |
||
102 | * @since 2019.04 |
||
103 | */ |
||
104 | public function parse( array $conditions ) |
||
109 | |||
110 | |||
111 | /** |
||
112 | * Returns the suppliers filtered by the previously assigned conditions |
||
113 | * |
||
114 | * @param string[] $domains Domain names of items that are associated with the suppliers and that should be fetched too |
||
115 | * @param integer &$total Parameter where the total number of found suppliers will be stored in |
||
116 | * @return \Aimeos\MShop\Supplier\Item\Iface[] Ordered list of supplier items |
||
117 | * @since 2019.04 |
||
118 | */ |
||
119 | public function search( $domains = ['media', 'text'], &$total = null ) |
||
124 | |||
125 | |||
126 | /** |
||
127 | * Sets the start value and the number of returned supplier items for slicing the list of found supplier items |
||
128 | * |
||
129 | * @param integer $start Start value of the first supplier item in the list |
||
130 | * @param integer $limit Number of returned supplier items |
||
131 | * @return \Aimeos\Controller\Frontend\Supplier\Iface Supplier controller for fluent interface |
||
132 | * @since 2019.04 |
||
133 | */ |
||
134 | public function slice( $start, $limit ) |
||
139 | |||
140 | |||
141 | /** |
||
142 | * Sets the sorting of the result list |
||
143 | * |
||
144 | * @param string|null $key Sorting key of the result list like "supplier.label", null for no sorting |
||
145 | * @return \Aimeos\Controller\Frontend\Supplier\Iface Supplier controller for fluent interface |
||
146 | * @since 2019.04 |
||
147 | */ |
||
148 | public function sort( $key = null ) |
||
169 | } |
||
170 |