1 | <?php |
||
10 | class RedirectorPageController extends PageController |
||
11 | { |
||
12 | private static $allowed_actions = ['index']; |
||
13 | |||
14 | /** |
||
15 | * Check we don't already have a redirect code set |
||
16 | * |
||
17 | * @param HTTPRequest $request |
||
18 | * @return \SilverStripe\Control\HTTPResponse |
||
19 | */ |
||
20 | public function index(HTTPRequest $request) |
||
29 | |||
30 | /** |
||
31 | * If we ever get this far, it means that the redirection failed. |
||
32 | */ |
||
33 | public function getContent() |
||
39 | } |
||
40 |
This check looks for a call to a parent method whose name is different than the method from which it is called.
Consider the following code:
The
getFirstName()
method in theSon
calls the wrong method in the parent class.