Ojs\ApiBundle\Controller\ApiController::throw404IfNotFound PHP Method

throw404IfNotFound() protected method

protected throw404IfNotFound ( mixed $entity, string $message = 'Not Found' ) : boolean
$entity mixed
$message string custom not found message
return boolean
    protected function throw404IfNotFound($entity, $message = 'Not Found')
    {
        if (!$entity) {
            throw new NotFoundHttpException('The resource not found.');
        }
        return true;
    }