Total Complexity | 13 |
Total Lines | 62 |
Duplicated Lines | 0 % |
Coverage | 86.96% |
Changes | 0 |
1 | <?php |
||
14 | class ManageableObjectExtension extends DataExtension |
||
15 | { |
||
16 | |||
17 | /** |
||
18 | * Get the listing page to view this Event on (used in Link functions below) |
||
19 | * |
||
20 | * @return mixed |
||
21 | */ |
||
22 | 4 | public function getListingPage() |
|
23 | { |
||
24 | |||
25 | 4 | $listingClass = $this->owner->config()->get('listing_page_class'); |
|
|
|||
26 | |||
27 | 4 | if ($listingPage = $listingClass::get()->first()) { |
|
28 | 4 | return $listingPage; |
|
29 | } |
||
30 | |||
31 | return false; |
||
32 | } |
||
33 | |||
34 | /** |
||
35 | * @return bool |
||
36 | */ |
||
37 | 1 | public function getAddLink() |
|
38 | { |
||
39 | 1 | if ($this->owner->getListingPage()->hasMethod('Link') && $this->owner->canCreate(Security::getCurrentUser())) { |
|
40 | 1 | return $this->owner->getListingPage()->Link('add'); |
|
41 | } |
||
42 | |||
43 | 1 | return false; |
|
44 | } |
||
45 | |||
46 | /** |
||
47 | * @return bool|String |
||
48 | */ |
||
49 | 1 | public function getEditLink() |
|
60 | } |
||
61 | |||
62 | /** |
||
63 | * @return bool|String |
||
64 | */ |
||
65 | 1 | public function getDeleteLink() |
|
76 | } |
||
77 | |||
78 | } |
||
79 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.