1 | <?php |
||
15 | abstract class NestedResourceRestController extends BaseRestController { |
||
|
|||
16 | /** |
||
17 | * @var string the error message if no id was provided for the request |
||
18 | */ |
||
19 | protected static $no_id_message = "No id provided."; |
||
20 | /** |
||
21 | * @var int the error code for a not provided id |
||
22 | */ |
||
23 | protected static $no_id_error = 404; |
||
24 | |||
25 | /** |
||
26 | * Get called by the action handler of BaseRestController. Tries to fetch the root resource. |
||
27 | * |
||
28 | * @param SS_HTTPRequest $request a http request |
||
29 | * @param string $action the name of the action (eg. post, put, get, delete) |
||
30 | * @return array the result of the action call |
||
31 | * @throws RestSystemException |
||
32 | * @throws RestUserException |
||
33 | */ |
||
34 | public final function beforeCallActionHandler(SS_HTTPRequest $request, $action) { |
||
47 | |||
48 | /** |
||
49 | * |
||
50 | * The result of this method will be injected in all method calls in the controller. |
||
51 | * |
||
52 | * @param string $id the `ID` param in the request |
||
53 | * @return mixed |
||
54 | */ |
||
55 | protected abstract function getRootResource($id); |
||
56 | |||
57 | } |
||
58 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.