protected function renderValidationSerializerAsJson(ValidationBaseSerializerException $error) {
		// Set the view class as json and render as json
		$this->controller->viewClass = 'Json';
		$this->controller->response->type('json');
		$this->addHttpCodes();
		$this->controller->response->statusCode($error->status());

		// set the errors object to match JsonApi's standard
		$errors = array(
			'errors' => $error->validationErrors(),
		);

		// json encode the errors
		$jsonEncodedErrors = json_encode($errors);

		// set the body to the json encoded errors
		$this->controller->response->body($jsonEncodedErrors);
		return $this->controller->response->send();
	}
protected function renderValidationSerializerAsJson(ValidationBaseSerializerException $error) {
		// Set the view class as json and render as json
		$this->controller->viewClass = 'Json';
		$this->controller->response->type('json');
		$this->addHttpCodes();
		$this->controller->response->statusCode($error->status());

		// set the errors object to match JsonApi's standard
		$errors = array(
			'errors' => $error->validationErrors(),
		);

		// json encode the errors
		$jsonEncodedErrors = json_encode($errors);

		// set the body to the json encoded errors
		$this->controller->response->body($jsonEncodedErrors);
		return $this->controller->response->send();
	}
protected function renderValidationSerializerAsJson ( ValidationBaseSerializerException $ error ) { // Set the view class as json and render as json $ this -> controller -> viewClass = 'Json' ; $ this -> controller -> response -> type ( 'json' ) ; $ this -> addHttpCodes ( ) ; $ this -> controller -> response -> statusCode ( $ error -> status ( ) ) ; // set the errors object to match JsonApi's standard $ errors = array ( 'errors' => $ error -> validationErrors ( ) , ) ; // json encode the errors $ jsonEncodedErrors = json_encode ( $ errors ) ; // set the body to the json encoded errors $ this -> controller -> response -> body ( $ jsonEncodedErrors ) ; return $ this -> controller -> response -> send ( ) ; }
render the ValidationBaseSerializerException for a JSON request

@param ValidationBaseSerializerException $error an instance of ValidationBaseSerializerException
@return void
render the ValidationBaseSerializerException for a JSON request