1 | <?php |
||
20 | abstract class Base |
||
21 | implements \Aimeos\Controller\Frontend\Common\Decorator\Iface |
||
1 ignored issue
–
show
|
|||
22 | { |
||
23 | private $context; |
||
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 ) |
||
45 | |||
46 | |||
47 | /** |
||
48 | * Passes unknown methods to wrapped objects. |
||
49 | * |
||
50 | * @param string $name Name of the method |
||
51 | * @param array $param List of method parameter |
||
52 | * @return mixed Returns the value of the called method |
||
53 | * @throws \Aimeos\Controller\Frontend\Exception If method call failed |
||
54 | */ |
||
55 | public function __call( $name, array $param ) |
||
59 | |||
60 | |||
61 | /** |
||
62 | * Returns the given search filter with the conditions attached for filtering by product code |
||
63 | * |
||
64 | * @param \Aimeos\MW\Criteria\Iface $filter Criteria object used for stock search |
||
65 | * @param array $codes List of product codes |
||
66 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
||
67 | * @since 2017.03 |
||
68 | */ |
||
69 | public function addFilterCodes( \Aimeos\MW\Criteria\Iface $filter, array $codes ) |
||
73 | |||
74 | |||
75 | /** |
||
76 | * Returns the given search filter with the conditions attached for filtering by type code |
||
77 | * |
||
78 | * @param \Aimeos\MW\Criteria\Iface $filter Criteria object used for stock search |
||
79 | * @param array $codes List of stock type codes |
||
80 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
||
81 | * @since 2017.03 |
||
82 | */ |
||
83 | public function addFilterTypes( \Aimeos\MW\Criteria\Iface $filter, array $codes ) |
||
87 | |||
88 | |||
89 | /** |
||
90 | * Returns the default stock filter |
||
91 | * |
||
92 | * @param boolean True to add default criteria |
||
93 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
||
94 | * @since 2017.03 |
||
95 | */ |
||
96 | public function createFilter() |
||
100 | |||
101 | |||
102 | /** |
||
103 | * Returns the stock item for the given stock ID |
||
104 | * |
||
105 | * @param string $id Unique stock ID |
||
106 | * @param string[] $domains Domain names of items that are associated with the stocks and that should be fetched too |
||
107 | * @return \Aimeos\MShop\Stock\Item\Iface Stock item including the referenced domains items |
||
108 | * @since 2017.03 |
||
109 | */ |
||
110 | public function getItem( $id ) |
||
114 | |||
115 | |||
116 | /** |
||
117 | * Returns the stocks filtered by the given criteria object |
||
118 | * |
||
119 | * @param \Aimeos\MW\Criteria\Iface $filter Critera object which contains the filter conditions |
||
120 | * @param integer &$total Parameter where the total number of found stocks will be stored in |
||
121 | * @return array Ordered list of stock items implementing \Aimeos\MShop\Stock\Item\Iface |
||
122 | * @since 2017.03 |
||
123 | */ |
||
124 | public function searchItems( \Aimeos\MW\Criteria\Iface $filter, &$total = null ) |
||
128 | |||
129 | |||
130 | /** |
||
131 | * Returns the context item |
||
132 | * |
||
133 | * @return \Aimeos\MShop\Context\Item\Iface Context item object |
||
134 | */ |
||
135 | protected function getContext() |
||
139 | |||
140 | |||
141 | /** |
||
142 | * Returns the frontend controller |
||
143 | * |
||
144 | * @return \Aimeos\Controller\Frontend\Stock\Iface Frontend controller object |
||
145 | */ |
||
146 | protected function getController() |
||
150 | } |
||
151 |