1 | <?php |
||
13 | class AccountPage extends Page |
||
14 | { |
||
15 | |||
16 | /** |
||
17 | * standard SS variable. |
||
18 | * |
||
19 | *@var array |
||
20 | */ |
||
21 | private static $casting = array( |
||
22 | 'RunningTotal' => 'Currency', |
||
23 | 'RunningPaid' => 'Currency', |
||
24 | 'RunningOutstanding' => 'Currency', |
||
25 | ); |
||
26 | |||
27 | /** |
||
28 | *@var float |
||
29 | */ |
||
30 | protected $calculatedTotal = 0; |
||
31 | |||
32 | /** |
||
33 | *@var float |
||
34 | */ |
||
35 | protected $calculatedPaid = 0; |
||
36 | |||
37 | /** |
||
38 | *@var float |
||
39 | */ |
||
40 | protected $calculatedOutstanding = 0; |
||
41 | |||
42 | /** |
||
43 | *@var DataList |
||
44 | */ |
||
45 | protected $pastOrders = null; |
||
46 | |||
47 | /** |
||
48 | * Standard SS variable. |
||
49 | * |
||
50 | * @Var String |
||
51 | */ |
||
52 | private static $icon = 'ecommerce/images/icons/AccountPage'; |
||
53 | |||
54 | /** |
||
55 | * Standard SS function, we only allow for one AccountPage to exist |
||
56 | * but we do allow for extensions to exist at the same time. |
||
57 | * |
||
58 | * @param Member $member |
||
|
|||
59 | * |
||
60 | * @return bool |
||
61 | **/ |
||
62 | public function canCreate($member = null) |
||
66 | |||
67 | /** |
||
68 | * Shop Admins can edit. |
||
69 | * |
||
70 | * @param Member $member |
||
71 | * |
||
72 | * @return bool |
||
73 | */ |
||
74 | public function canEdit($member = null) |
||
82 | |||
83 | /** |
||
84 | * Standard SS method. |
||
85 | * |
||
86 | * @param Member $member |
||
87 | * |
||
88 | * @return bool |
||
89 | */ |
||
90 | public function canDelete($member = null) |
||
94 | |||
95 | /** |
||
96 | * Standard SS method. |
||
97 | * |
||
98 | * @param Member $member |
||
99 | * |
||
100 | * @return bool |
||
101 | */ |
||
102 | public function canPublish($member = null) |
||
106 | |||
107 | /** |
||
108 | * standard SS variable. |
||
109 | * |
||
110 | * @Var String |
||
111 | */ |
||
112 | private static $singular_name = 'Account Page'; |
||
113 | public function i18n_singular_name() |
||
117 | |||
118 | /** |
||
119 | * standard SS variable. |
||
120 | * |
||
121 | * @Var String |
||
122 | */ |
||
123 | private static $plural_name = 'Account Pages'; |
||
124 | public function i18n_plural_name() |
||
128 | |||
129 | /** |
||
130 | * Standard SS variable. |
||
131 | * |
||
132 | * @var string |
||
133 | */ |
||
134 | private static $description = 'A page where the customer can view all their orders and update their details.'; |
||
135 | |||
136 | /** |
||
137 | * Returns the link to the AccountPage on this site. |
||
138 | * @param string $action [optional] |
||
139 | * @return string (URLSegment) |
||
140 | */ |
||
141 | public static function find_link($action = null) |
||
151 | |||
152 | /** |
||
153 | * Returns a list of all previous orders for the member / account. |
||
154 | * |
||
155 | * @return DataList |
||
156 | */ |
||
157 | public function PastOrders() |
||
163 | |||
164 | /** |
||
165 | * casted variable. |
||
166 | * |
||
167 | * @return float (casted as Currency) |
||
168 | */ |
||
169 | public function getRunningTotal() |
||
179 | |||
180 | /** |
||
181 | * casted variable. |
||
182 | * |
||
183 | * @return float (casted as Currency) |
||
184 | */ |
||
185 | public function getRunningPaid() |
||
195 | |||
196 | /** |
||
197 | * casted variable. |
||
198 | * |
||
199 | * @return float (casted as Currency) |
||
200 | */ |
||
201 | public function getRunningOutstanding() |
||
211 | |||
212 | /** |
||
213 | * retrieves previous orders and adds totals to it... |
||
214 | * return DataList. |
||
215 | **/ |
||
216 | protected function calculatePastOrders() |
||
236 | |||
237 | /** |
||
238 | * @return DataList (Orders) |
||
239 | */ |
||
240 | protected function pastOrdersSelection() |
||
258 | |||
259 | /** |
||
260 | * tells us if the current page is part of e-commerce. |
||
261 | * |
||
262 | * @return bool |
||
263 | */ |
||
264 | public function IsEcommercePage() |
||
268 | } |
||
269 | |||
327 |
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.