| 1 | <?php |
||
| 20 | abstract class Base |
||
| 21 | extends \Aimeos\Controller\Frontend\Base |
||
|
2 ignored issues
–
show
|
|||
| 22 | implements \Aimeos\Controller\Frontend\Common\Decorator\Iface, \Aimeos\Controller\Frontend\Customer\Iface |
||
|
1 ignored issue
–
show
|
|||
| 23 | { |
||
| 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 ) |
||
| 46 | |||
| 47 | |||
| 48 | /** |
||
| 49 | * Passes unknown methods to wrapped objects. |
||
| 50 | * |
||
| 51 | * @param string $name Name of the method |
||
| 52 | * @param array $param List of method parameter |
||
| 53 | * @return mixed Returns the value of the called method |
||
| 54 | * @throws \Aimeos\Controller\Frontend\Exception If method call failed |
||
| 55 | */ |
||
| 56 | public function __call( $name, array $param ) |
||
| 60 | |||
| 61 | |||
| 62 | /** |
||
| 63 | * Adds and returns a new customer item object |
||
| 64 | * |
||
| 65 | * @param array $values Values added to the newly created customer item like "customer.birthday" |
||
| 66 | * @return \Aimeos\MShop\Customer\Item\Iface Customer item |
||
| 67 | * @since 2017.04 |
||
| 68 | */ |
||
| 69 | public function addItem( array $values ) |
||
| 73 | |||
| 74 | |||
| 75 | /** |
||
| 76 | * Creates a new customer item object pre-filled with the given values but not yet stored |
||
| 77 | * |
||
| 78 | * @return \Aimeos\MShop\Customer\Item\Iface Customer item |
||
| 79 | * @since 2017.04 |
||
| 80 | */ |
||
| 81 | public function createItem( array $values = [] ) |
||
| 85 | |||
| 86 | |||
| 87 | /** |
||
| 88 | * Deletes a customer item that belongs to the current authenticated user |
||
| 89 | * |
||
| 90 | * @param string $id Unique customer ID |
||
| 91 | * @since 2017.04 |
||
| 92 | */ |
||
| 93 | public function deleteItem( $id ) |
||
| 97 | |||
| 98 | |||
| 99 | /** |
||
| 100 | * Updates the customer item identified by its ID |
||
| 101 | * |
||
| 102 | * @param string $id Unique customer ID |
||
| 103 | * @param array $values Values added to the customer item like "customer.birthday" or "customer.city" |
||
| 104 | * @return \Aimeos\MShop\Customer\Item\Iface Customer item |
||
| 105 | * @since 2017.04 |
||
| 106 | */ |
||
| 107 | public function editItem( $id, array $values ) |
||
| 111 | |||
| 112 | |||
| 113 | /** |
||
| 114 | * Returns the customer item for the given customer ID |
||
| 115 | * |
||
| 116 | * @param string|null $id Unique customer ID or null for current customer item |
||
| 117 | * @param string[] $domains Domain names of items that are associated with the customers and that should be fetched too |
||
| 118 | * @return \Aimeos\MShop\Customer\Item\Iface Customer item including the referenced domains items |
||
| 119 | * @since 2017.04 |
||
| 120 | */ |
||
| 121 | public function getItem( $id = null, array $domains = [] ) |
||
| 125 | |||
| 126 | |||
| 127 | /** |
||
| 128 | * Returns the customer item for the given customer code (usually e-mail address) |
||
| 129 | * |
||
| 130 | * This method doesn't check if the customer item belongs to the logged in user! |
||
| 131 | * |
||
| 132 | * @param string $code Unique customer code |
||
| 133 | * @param string[] $domains Domain names of items that are associated with the customers and that should be fetched too |
||
| 134 | * @return \Aimeos\MShop\Customer\Item\Iface Customer item including the referenced domains items |
||
| 135 | * @since 2017.04 |
||
| 136 | */ |
||
| 137 | public function findItem( $code, array $domains = [] ) |
||
| 141 | |||
| 142 | |||
| 143 | /** |
||
| 144 | * Stores a modified customer item |
||
| 145 | * |
||
| 146 | * @param \Aimeos\MShop\Customer\Item\Iface Customer item |
||
| 147 | * @since 2017.04 |
||
| 148 | */ |
||
| 149 | public function saveItem( \Aimeos\MShop\Customer\Item\Iface $item ) |
||
| 153 | |||
| 154 | |||
| 155 | /** |
||
| 156 | * Creates and returns a new address item object |
||
| 157 | * |
||
| 158 | * @param array $values Values added to the newly created customer item like "customer.birthday" |
||
| 159 | * @return \Aimeos\MShop\Customer\Item\Iface Customer address item |
||
| 160 | * @since 2017.04 |
||
| 161 | */ |
||
| 162 | public function addAddressItem( array $values ) |
||
| 166 | |||
| 167 | |||
| 168 | /** |
||
| 169 | * Creates a new customer address item object pre-filled with the given values but not yet stored |
||
| 170 | * |
||
| 171 | * @return \Aimeos\MShop\Customer\Item\Address\Iface Customer address item |
||
| 172 | * @since 2017.04 |
||
| 173 | */ |
||
| 174 | public function createAddressItem( array $values = [] ) |
||
| 178 | |||
| 179 | |||
| 180 | /** |
||
| 181 | * Deletes a address item that belongs to the current authenticated user |
||
| 182 | * |
||
| 183 | * @param string $id Unique customer address ID |
||
| 184 | * @since 2017.04 |
||
| 185 | */ |
||
| 186 | public function deleteAddressItem( $id ) |
||
| 190 | |||
| 191 | |||
| 192 | /** |
||
| 193 | * Saves a modified address item object |
||
| 194 | * |
||
| 195 | * @param string $id Unique customer address ID |
||
| 196 | * @param array $values Values added to the address item like "customer.address.city" |
||
| 197 | * @return \Aimeos\MShop\Customer\Item\Iface Customer address item |
||
| 198 | * @since 2017.04 |
||
| 199 | */ |
||
| 200 | public function editAddressItem( $id, array $values ) |
||
| 204 | |||
| 205 | |||
| 206 | /** |
||
| 207 | * Returns the address item for the given ID |
||
| 208 | * |
||
| 209 | * @param string $id Unique customer address ID |
||
| 210 | * @return \Aimeos\MShop\Customer\Item\Address\Iface Customer address item |
||
| 211 | * @since 2017.04 |
||
| 212 | */ |
||
| 213 | public function getAddressItem( $id ) |
||
| 217 | |||
| 218 | |||
| 219 | /** |
||
| 220 | * Stores a modified customer address item |
||
| 221 | * |
||
| 222 | * @param \Aimeos\MShop\Customer\Item\Address\Iface Customer address item |
||
| 223 | * @since 2017.04 |
||
| 224 | */ |
||
| 225 | public function saveAddressItem( \Aimeos\MShop\Customer\Item\Address\Iface $item ) |
||
| 229 | |||
| 230 | |||
| 231 | /** |
||
| 232 | * Returns the frontend controller |
||
| 233 | * |
||
| 234 | * @return \Aimeos\Controller\Frontend\Customer\Iface Frontend controller object |
||
| 235 | * @since 2017.04 |
||
| 236 | */ |
||
| 237 | protected function getController() |
||
| 241 | } |
||
| 242 |