1 | <?php |
||
16 | class CheckoutSteps extends SS_Object |
||
17 | { |
||
18 | private static $checkout_steps = array( |
||
19 | 'register', |
||
20 | 'summary', |
||
21 | 'success' |
||
22 | ); |
||
23 | |||
24 | /** |
||
25 | * Return the first step |
||
26 | * |
||
27 | * @return string |
||
28 | */ |
||
29 | public static function start() |
||
34 | |||
35 | /** |
||
36 | * Return the next step |
||
37 | * |
||
38 | * @param $step |
||
39 | * |
||
40 | * @return null |
||
41 | */ |
||
42 | public static function nextStep($step) |
||
52 | |||
53 | /** |
||
54 | * Return an unique array of steps |
||
55 | * |
||
56 | * @return array |
||
57 | */ |
||
58 | public static function getSteps() |
||
62 | |||
63 | /** |
||
64 | * Get the formatted steps |
||
65 | * |
||
66 | * @param CheckoutStepController $controller |
||
67 | * |
||
68 | * @return ArrayList |
||
69 | */ |
||
70 | public static function get(CheckoutStepController $controller) |
||
86 | |||
87 | /** |
||
88 | * Get the index of the given step |
||
89 | * |
||
90 | * @param $step |
||
91 | * |
||
92 | * @return mixed |
||
93 | */ |
||
94 | private static function getStepIndex($step) { |
||
98 | |||
99 | /** |
||
100 | * Check if the step is in the past |
||
101 | * |
||
102 | * @param $step |
||
103 | * @param CheckoutStepController $controller |
||
104 | * |
||
105 | * @return bool |
||
106 | */ |
||
107 | private static function inPast($step, CheckoutStepController $controller) |
||
112 | |||
113 | /** |
||
114 | * Check if the step is in the future |
||
115 | * |
||
116 | * @param $step |
||
117 | * @param CheckoutStepController $controller |
||
118 | * |
||
119 | * @return bool |
||
120 | */ |
||
121 | private static function inFuture($step, CheckoutStepController $controller) |
||
126 | |||
127 | /** |
||
128 | * Check at the current step |
||
129 | * |
||
130 | * @param $step |
||
131 | * @param CheckoutStepController $controller |
||
132 | * |
||
133 | * @return bool |
||
134 | */ |
||
135 | private static function current($step, CheckoutStepController $controller) |
||
140 | } |
||
141 |