| Conditions | 3 |
| Paths | 4 |
| Total Lines | 18 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 46 | protected function canRemoveFromWishList() |
||
| 47 | { |
||
| 48 | $request = Controller::curr()->getRequest(); |
||
| 49 | $list = ProductWishList::get()->filter([ |
||
| 50 | 'URLSegment' => $request->param('ID'), |
||
| 51 | ])->first(); |
||
| 52 | |||
| 53 | if (!$list) { |
||
| 54 | $list = ProductWishList::get()->filter([ |
||
| 55 | 'MemberID' => Security::getCurrentUser()->ID, |
||
| 56 | ])->first(); |
||
| 57 | } |
||
| 58 | |||
| 59 | if (!$list) { |
||
| 60 | return false; |
||
| 61 | } |
||
| 62 | |||
| 63 | return $list->canEdit(Security::getCurrentUser()); |
||
| 64 | } |
||
| 66 |