| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | public function getRemoveLink() |
||
| 23 | { |
||
| 24 | $wishListPage = Config::inst()->get(ProductWishList::class, 'listing_page_class'); |
||
| 25 | /** @var \SilverStripe\CMS\Model\SiteTree $page */ |
||
| 26 | $page = $page = $wishListPage::get()->first(); |
||
|
|
|||
| 27 | |||
| 28 | if (!$page) { |
||
| 29 | return false; |
||
| 30 | } |
||
| 31 | |||
| 32 | if (!$this->canRemoveFromWishList()) { |
||
| 33 | return false; |
||
| 34 | } |
||
| 35 | |||
| 36 | return Controller::join_links( |
||
| 37 | $page->Link('remove'), |
||
| 38 | Controller::curr()->getRequest()->param('ID'), |
||
| 39 | $this->owner->ID |
||
| 40 | ); |
||
| 64 |