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 | private $root; |
||
28 | |||
29 | |||
30 | /** |
||
31 | * Common initialization for controller classes |
||
32 | * |
||
33 | * @param \Aimeos\MShop\Context\Item\Iface $context Common MShop context object |
||
34 | */ |
||
35 | public function __construct( \Aimeos\MShop\Context\Item\Iface $context ) |
||
43 | |||
44 | |||
45 | /** |
||
46 | * Clones objects in controller and resets values |
||
47 | */ |
||
48 | public function __clone() |
||
52 | |||
53 | |||
54 | /** |
||
55 | * Adds generic condition for filtering attributes |
||
56 | * |
||
57 | * @param string $operator Comparison operator, e.g. "==", "!=", "<", "<=", ">=", ">", "=~", "~=" |
||
58 | * @param string $key Search key defined by the catalog manager, e.g. "catalog.status" |
||
59 | * @param array|string $value Value or list of values to compare to |
||
60 | * @return \Aimeos\Controller\Frontend\Catalog\Iface Catalog controller for fluent interface |
||
61 | * @since 2019.04 |
||
62 | */ |
||
63 | public function compare( $operator, $key, $value ) |
||
68 | |||
69 | |||
70 | /** |
||
71 | * Returns the category for the given catalog ID |
||
72 | * |
||
73 | * @param string $id Unique catalog ID |
||
74 | * @param string[] $domains Domain names of items that are associated with the category and should be fetched too |
||
75 | * @return \Aimeos\MShop\Catalog\Item\Iface Catalog item including the referenced domains items |
||
76 | * @since 2019.04 |
||
77 | */ |
||
78 | public function get( $id, array $domains = ['media', 'text'] ) |
||
82 | |||
83 | |||
84 | /** |
||
85 | * Returns the list of categories up to the root node including the node given by its ID |
||
86 | * |
||
87 | * @param integer $id Current category ID |
||
88 | * @param string[] $domains Domain names of items that are associated to the categories and should be fetched too |
||
89 | * @return \Aimeos\MShop\Catalog\Item\Iface[] Associative list of categories |
||
90 | * @since 2017.03 |
||
91 | */ |
||
92 | public function getPath( $id, array $domains = ['text', 'media'] ) |
||
109 | |||
110 | |||
111 | /** |
||
112 | * Returns the categories filtered by the previously assigned conditions |
||
113 | * |
||
114 | * @param string[] $domains Domain names of items that are associated to the categories and should be fetched too |
||
115 | * @param integer $level Constant from \Aimeos\MW\Tree\Manager\Base, e.g. LEVEL_ONE, LEVEL_LIST or LEVEL_TREE |
||
116 | * @return \Aimeos\MShop\Catalog\Item\Iface Category tree |
||
117 | * @since 2019.04 |
||
118 | */ |
||
119 | public function getTree( array $domains = ['media', 'text'], $level = \Aimeos\MW\Tree\Manager\Base::LEVEL_TREE ) |
||
124 | |||
125 | |||
126 | /** |
||
127 | * Returns the category for the given catalog code |
||
128 | * |
||
129 | * @param string $code Unique catalog code |
||
130 | * @param string[] $domains Domain names of items that are associated to the categories and should be fetched too |
||
131 | * @return \Aimeos\MShop\Catalog\Item\Iface Catalog item including the referenced domains items |
||
132 | * @since 2019.04 |
||
133 | */ |
||
134 | public function find( $code, array $domains = ['media', 'text'] ) |
||
138 | |||
139 | |||
140 | /** |
||
141 | * Parses the given array and adds the conditions to the list of conditions |
||
142 | * |
||
143 | * @param array $conditions List of conditions, e.g. ['>' => ['catalog.status' => 0]] |
||
144 | * @return \Aimeos\Controller\Frontend\Catalog\Iface Catalog controller for fluent interface |
||
145 | * @since 2019.04 |
||
146 | */ |
||
147 | public function parse( array $conditions ) |
||
152 | |||
153 | |||
154 | /** |
||
155 | * Sets the catalog ID of node that is used as root node |
||
156 | * |
||
157 | * @param string|null $id Catalog ID |
||
158 | * @return \Aimeos\Controller\Frontend\Catalog\Iface Catalog controller for fluent interface |
||
159 | * @since 2019.04 |
||
160 | */ |
||
161 | public function root( $id ) |
||
166 | |||
167 | |||
168 | /** |
||
169 | * Limits categories returned to only visible ones depending on the given category IDs |
||
170 | * |
||
171 | * @param array $catIds List of category IDs |
||
172 | * @return \Aimeos\Controller\Frontend\Catalog\Iface Catalog controller for fluent interface |
||
173 | */ |
||
174 | public function visible( array $catIds ) |
||
245 | } |
||
246 |