1 | <?php |
||
3 | class DMSDocumentCartCheckoutPage_Controller extends Page_Controller |
||
|
|||
4 | { |
||
5 | private static $allowed_actions = array( |
||
6 | 'DMSDocumentRequestForm', |
||
7 | 'complete' |
||
8 | ); |
||
9 | |||
10 | /** |
||
11 | * An array containing the recipients basic information |
||
12 | * |
||
13 | * @var array |
||
14 | */ |
||
15 | public static $receiverInfo = array( |
||
16 | 'ReceiverName' => '', |
||
17 | 'ReceiverPhone' => '', |
||
18 | 'ReceiverEmail' => '', |
||
19 | 'DeliveryAddressLine1' => '', |
||
20 | 'DeliveryAddressLine2' => '', |
||
21 | 'DeliveryAddressCountry' => '', |
||
22 | 'DeliveryAddressPostCode' => '', |
||
23 | ); |
||
24 | |||
25 | public function init() |
||
31 | |||
32 | /** |
||
33 | * Gets and displays an editable list of items within the cart, as well as a contact form with entry |
||
34 | * fields for the recipients information. |
||
35 | * |
||
36 | * To extend use the following from within an Extension subclass: |
||
37 | * |
||
38 | * <code> |
||
39 | * public function updateDMSDocumentRequestForm($form) |
||
40 | * { |
||
41 | * // Do something here |
||
42 | * } |
||
43 | * </code> |
||
44 | * |
||
45 | * @return Form |
||
46 | */ |
||
47 | public function DMSDocumentRequestForm() |
||
94 | |||
95 | /** |
||
96 | * Sends an email to both the configured recipient as well as the requester. The |
||
97 | * configured recipient is bcc'ed to the email in order to fulfill it. |
||
98 | * |
||
99 | * To extend use the following from within an Extension subclass: |
||
100 | * |
||
101 | * <code> |
||
102 | * public function updateSend($email) |
||
103 | * { |
||
104 | * // Do something here |
||
105 | * } |
||
106 | * </code> |
||
107 | * @return mixed |
||
108 | * |
||
109 | * @throws DMSDocumentCartException |
||
110 | */ |
||
111 | public function send() |
||
142 | |||
143 | /** |
||
144 | * Handles form submission. |
||
145 | * Totals requested are updated, delivery details added, email sent for fulfillment |
||
146 | * and print request totals updated. |
||
147 | * |
||
148 | * @param array $data |
||
149 | * @param Form $form |
||
150 | * @param SS_HTTPRequest $request |
||
151 | * |
||
152 | * @return SS_HTTPResponse |
||
153 | */ |
||
154 | public function doRequestSend($data, Form $form, SS_HTTPRequest $request) |
||
164 | |||
165 | /** |
||
166 | * Displays the preconfigured thank you message to the user upon completion |
||
167 | * |
||
168 | * @return ViewableData_Customised |
||
169 | */ |
||
170 | public function complete() |
||
180 | |||
181 | /** |
||
182 | * Retrieves a {@link DMSDocumentCart} instance |
||
183 | * |
||
184 | * @return DMSDocumentCart |
||
185 | */ |
||
186 | public function getCart() |
||
190 | |||
191 | /** |
||
192 | * Updates the document quantities just before the request is sent. |
||
193 | * |
||
194 | * @param array $data |
||
195 | */ |
||
196 | public function updateCartItems($data) |
||
209 | |||
210 | /** |
||
211 | * Updates the cart receiver info just before the request is sent. |
||
212 | * |
||
213 | * @param array $data |
||
214 | */ |
||
215 | public function updateCartReceiverInfo($data) |
||
220 | } |
||
221 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.