Total Complexity | 4 |
Total Lines | 34 |
Duplicated Lines | 0 % |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | class MemberExtension extends DataExtension |
||
13 | { |
||
14 | /** |
||
15 | * Get the currenty active shopping cart on a member |
||
16 | * |
||
17 | * @return ShoppingCart |
||
18 | */ |
||
19 | public function getCart() |
||
20 | { |
||
21 | return $this |
||
22 | ->getOwner() |
||
23 | ->Contact() |
||
24 | ->Estimates() |
||
25 | ->find("ClassName", ShoppingCart::class); |
||
26 | } |
||
27 | |||
28 | /** |
||
29 | * Update the current cart. Also make sure no more than one is |
||
30 | * set at any one time. |
||
31 | * |
||
32 | * @return self |
||
33 | */ |
||
34 | public function setCart(ShoppingCart $cart) |
||
46 | } |
||
47 | } |
||
48 |