| 1 | <?php |
||
| 20 | abstract class Base |
||
| 21 | extends \Aimeos\Controller\Frontend\Base |
||
|
2 ignored issues
–
show
|
|||
| 22 | implements \Aimeos\Controller\Frontend\Common\Decorator\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 | * Returns the service items that are available for the service type and the content of the basket. |
||
| 64 | * |
||
| 65 | * @param string $type Service type, e.g. "delivery" (shipping related) or "payment" (payment related) |
||
| 66 | * @param \Aimeos\MShop\Order\Item\Base\Iface $basket Basket of the user |
||
| 67 | * @param array $ref List of domains for which the items referenced by the services should be fetched too |
||
| 68 | * @return array List of service items implementing \Aimeos\MShop\Service\Item\Iface with referenced items |
||
| 69 | */ |
||
| 70 | public function getServices( $type, \Aimeos\MShop\Order\Item\Base\Iface $basket, |
||
| 75 | |||
| 76 | |||
| 77 | /** |
||
| 78 | * Returns the list of attribute definitions which must be used to render the input form where the customer can |
||
| 79 | * enter or chose the required data necessary by the service provider. |
||
| 80 | * |
||
| 81 | * @param string $type Service type, e.g. "delivery" (shipping related) or "payment" (payment related) |
||
| 82 | * @param string $serviceId Identifier of one of the service option returned by getService() |
||
| 83 | * @param \Aimeos\MShop\Order\Item\Base\Iface $basket Basket object |
||
| 84 | * @return array List of attribute definitions implementing \Aimeos\MW\Criteria\Attribute\Iface |
||
| 85 | */ |
||
| 86 | public function getServiceAttributes( $type, $serviceId, \Aimeos\MShop\Order\Item\Base\Iface $basket ) |
||
| 90 | |||
| 91 | |||
| 92 | /** |
||
| 93 | * Returns the price of the service. |
||
| 94 | * |
||
| 95 | * @param string $type Service type, e.g. "delivery" (shipping related) or "payment" (payment related) |
||
| 96 | * @param string $serviceId Identifier of one of the service option returned by getService() |
||
| 97 | * @param \Aimeos\MShop\Order\Item\Base\Iface $basket Basket with products |
||
| 98 | * @return \Aimeos\MShop\Price\Item\Iface Price item |
||
| 99 | * @throws \Aimeos\Controller\Frontend\Service\Exception If no active service provider for this ID is available |
||
| 100 | * @throws \Aimeos\MShop\Exception If service provider isn't available |
||
| 101 | * @throws \Exception If an error occurs |
||
| 102 | */ |
||
| 103 | public function getServicePrice( $type, $serviceId, \Aimeos\MShop\Order\Item\Base\Iface $basket ) |
||
| 107 | |||
| 108 | |||
| 109 | /** |
||
| 110 | * Returns a list of attributes that are invalid. |
||
| 111 | * |
||
| 112 | * @param string $type Service type, e.g. "delivery" (shipping related) or "payment" (payment related) |
||
| 113 | * @param string $serviceId Identifier of the service option chosen by the customer |
||
| 114 | * @param array $attributes List of key/value pairs with name of the attribute from attribute definition object as |
||
| 115 | * key and the string entered by the customer as value |
||
| 116 | * @return array List of key/value pairs of attributes keys and an error message for values that are invalid or |
||
| 117 | * missing |
||
| 118 | */ |
||
| 119 | public function checkServiceAttributes( $type, $serviceId, array $attributes ) |
||
| 123 | |||
| 124 | |||
| 125 | /** |
||
| 126 | * Returns the frontend controller |
||
| 127 | * |
||
| 128 | * @return \Aimeos\Controller\Frontend\Service\Iface Frontend controller object |
||
| 129 | */ |
||
| 130 | protected function getController() |
||
| 134 | } |
||
| 135 |