1 | <?php |
||
6 | class Checkout |
||
7 | { |
||
8 | /** |
||
9 | * 4 different membership schemes: |
||
10 | * 1: creation disabled & membership not required |
||
11 | * no body can, or is required to, become a member at checkout. |
||
12 | * 2: creation disabled & membership required |
||
13 | * only existing members can use checkout. |
||
14 | * (ideally the entire shop should be disabled in this case) |
||
15 | * 3: creation enabled & membership required |
||
16 | * everyone must be, or become a member at checkout. |
||
17 | * 4: creation enabled & membership not required (default) |
||
18 | * it is optional to be, or become a member at checkout. |
||
19 | */ |
||
20 | |||
21 | 11 | public static function member_creation_enabled() |
|
25 | |||
26 | 1 | public static function membership_required() |
|
30 | |||
31 | 4 | public static function get($order = null) |
|
41 | |||
42 | protected $order; |
||
43 | |||
44 | protected $message; |
||
45 | |||
46 | protected $type; |
||
47 | |||
48 | 14 | public function __construct(Order $order) |
|
52 | |||
53 | /** |
||
54 | * Get stored message |
||
55 | * |
||
56 | * @return string |
||
57 | */ |
||
58 | 1 | public function getMessage() |
|
62 | |||
63 | /** |
||
64 | * Get type of stored message |
||
65 | * |
||
66 | * @return string |
||
67 | */ |
||
68 | public function getMessageType() |
||
72 | |||
73 | /** |
||
74 | * contact information |
||
75 | */ |
||
76 | public function setContactDetails($email, $firstname, $surname) |
||
83 | |||
84 | //save / set up addresses |
||
85 | 1 | public function setShippingAddress(Address $address) |
|
97 | |||
98 | 1 | public function setBillingAddress(Address $address) |
|
107 | |||
108 | /* |
||
109 | * Get a dataobject of payment methods. |
||
110 | */ |
||
111 | 5 | public function getPaymentMethods() |
|
115 | |||
116 | /** |
||
117 | * Set payment method |
||
118 | */ |
||
119 | 5 | public function setPaymentMethod($paymentmethod) |
|
130 | |||
131 | /** |
||
132 | * Gets the selected payment method from the session, |
||
133 | * or the only available method, if there is only one. |
||
134 | */ |
||
135 | 5 | public function getSelectedPaymentMethod($nice = false) |
|
145 | |||
146 | /** |
||
147 | * Checks if member (or not) is allowed, in accordance with configuration |
||
148 | */ |
||
149 | 7 | public function validateMember($member) |
|
160 | 1 | ||
161 | /** |
||
162 | * Store a new error & return false; |
||
163 | 1 | */ |
|
164 | 1 | protected function error($message) |
|
169 | |||
170 | /** |
||
171 | * Store a message to be fed back to user. |
||
172 | * |
||
173 | * @param string $message |
||
174 | * @param string $type - good, bad, warning |
||
175 | */ |
||
176 | protected function message($message, $type = "good") |
||
181 | } |
||
182 |
Since your code implements the magic setter
_set
, this function will be called for any write access on an undefined variable. You can add the@property
annotation to your class or interface to document the existence of this variable.Since the property has write access only, you can use the @property-write annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.