Added new method for returning common 404 exceptions.

This commit is contained in:
Alex Tselegidis 2016-07-10 12:59:04 +02:00
parent f999716969
commit ba4aa48e47

View file

@ -81,6 +81,15 @@ class API_V1_Controller extends CI_Controller {
echo json_encode($error, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT); echo json_encode($error, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT);
} }
/**
* Throw an API exception stating that the requested record was not found.
*
* @throws \EA\Engine\Api\V1\Exception
*/
protected function _throwRecordNotFound() {
throw new \EA\Engine\Api\V1\Exception('The requested record was not found!', 404, 'Not Found');
}
} }
/* End of file API_V1_Controller.php */ /* End of file API_V1_Controller.php */