Moodle PHP Documentation 5.1
Moodle 5.1dev (Build: 20250706) (a6b17d8f6bd)
core\router\response\exception_response Class Reference
Inheritance diagram for core\router\response\exception_response:
core\router\schema\response\response core\router\schema\referenced_object core\router\schema\openapi_base core\router\response\access_denied_response core\router\response\invalid_parameter_response core\router\response\not_found_response

Public Member Functions

 __construct ()
 Constructor for a new exception-related response.
 
 get_openapi_description (specification $api, ?string $path=null,)
 Get the OpenAPI data to include in the OpenAPI specification.
 
 get_openapi_schema (specification $api, ?string $path=null,)
 Get the OpenAPI data to include in the OpenAPI specification.
 
 get_reference (bool $qualify=true,)
 Get the $ref for this class.
 
 get_schema_from_type (param $type)
 Get the schema for a given type.
 
 get_status_code ()
 Get the status code for this response.
 
 validate (ResponseInterface $response,)
 Validate the response.
 

Static Public Member Functions

static escape_reference (string $reference)
 Escape a reference following rules defined at https://swagger.io/docs/specification/using-ref/.
 
static get_reference_for_class (string $classname, bool $qualify=true,)
 Get the $ref a class name.
 
static get_reference_for_example (string $reference)
 Get the qualified $ref for an example.
 
static get_reference_for_header (string $reference)
 Get the qualified $ref for a parameter.
 
static get_reference_for_parameter (string $reference)
 Get the qualified $ref for a parameter.
 
static get_reference_for_request_body (string $reference)
 Get the qualified $ref for a request body.
 
static get_reference_for_response (string $reference)
 Get the qualified $ref for a response.
 
static get_reference_for_schema (string $reference)
 Get the qualified $ref for a schema.
 
static get_response (ServerRequestInterface $request, Exception $exception,... $extra,)
 Get the response for the exception.
 

Protected Member Functions

 get_description ()
 Get the description for this response.
 

Static Protected Member Functions

static get_exception_status_code ()
 The status code that this exception should return.
 
static get_payload_data (Exception $exception,... $extra,)
 Get the response payload data.
 
static get_response_description ()
 Get the description of this response.
 
static get_response_schema ()
 Get the schema for the response.
 

Member Function Documentation

◆ escape_reference()

static core\router\schema\openapi_base::escape_reference ( string $reference)
staticinherited

Escape a reference following rules defined at https://swagger.io/docs/specification/using-ref/.

Parameters
string$reference
Return values
string

◆ get_description()

core\router\schema\response\response::get_description ( )
protectedinherited

Get the description for this response.

Return values
string

◆ get_exception_status_code()

static core\router\response\exception_response::get_exception_status_code ( )
staticprotected

The status code that this exception should return.

Return values
int

Reimplemented in core\router\response\access_denied_response, core\router\response\invalid_parameter_response, and core\router\response\not_found_response.

◆ get_openapi_description()

core\router\schema\response\response::get_openapi_description ( specification $api,
?string $path = null )
inherited

Get the OpenAPI data to include in the OpenAPI specification.

Parameters
specification$api
null | string$path
Return values
null|stdClass

Reimplemented from core\router\schema\openapi_base.

◆ get_openapi_schema()

core\router\schema\openapi_base::get_openapi_schema ( specification $api,
?string $path = null )
finalinherited

Get the OpenAPI data to include in the OpenAPI specification.

Parameters
specification$api
null | string$path
Return values
null|stdClass
Exceptions
coding_exception

◆ get_payload_data()

static core\router\response\exception_response::get_payload_data ( Exception $exception,
... )
staticprotected

Get the response payload data.

Parameters
Exception$exception
mixed...$extra
Return values
array

◆ get_reference()

core\router\schema\openapi_base::get_reference ( bool $qualify = true)
inherited

Get the $ref for this class.

Parameters
bool$qualifyWhether to qualify the reference with the #/components/ part.
Return values
string

◆ get_reference_for_class()

static core\router\schema\openapi_base::get_reference_for_class ( string $classname,
bool $qualify = true )
staticinherited

Get the $ref a class name.

https://swagger.io/docs/specification/using-ref/

Parameters
string$classnameThe class to get a reference for
bool$qualifyWhether to qualify the reference with the #/components/ part
Return values
stringThe reference
Exceptions
coding_exception

◆ get_reference_for_example()

static core\router\schema\openapi_base::get_reference_for_example ( string $reference)
staticinherited

Get the qualified $ref for an example.

Parameters
string$reference
Return values
string

◆ get_reference_for_header()

static core\router\schema\openapi_base::get_reference_for_header ( string $reference)
staticinherited

Get the qualified $ref for a parameter.

Parameters
string$reference
Return values
string

◆ get_reference_for_parameter()

static core\router\schema\openapi_base::get_reference_for_parameter ( string $reference)
staticinherited

Get the qualified $ref for a parameter.

Parameters
string$reference
Return values
string

◆ get_reference_for_request_body()

static core\router\schema\openapi_base::get_reference_for_request_body ( string $reference)
staticinherited

Get the qualified $ref for a request body.

Parameters
string$reference
Return values
string

◆ get_reference_for_response()

static core\router\schema\openapi_base::get_reference_for_response ( string $reference)
staticinherited

Get the qualified $ref for a response.

Parameters
string$reference
Return values
string

◆ get_reference_for_schema()

static core\router\schema\openapi_base::get_reference_for_schema ( string $reference)
staticinherited

Get the qualified $ref for a schema.

Parameters
string$reference
Return values
string

◆ get_response()

static core\router\response\exception_response::get_response ( ServerRequestInterface $request,
Exception $exception,
... )
static

Get the response for the exception.

Parameters
ServerRequestInterface$request
Exception$exception
mixed[]...$extra
Return values
payload_response

◆ get_response_description()

static core\router\response\exception_response::get_response_description ( )
staticabstractprotected

Get the description of this response.

Return values
string

Reimplemented in core\router\response\access_denied_response, core\router\response\invalid_parameter_response, and core\router\response\not_found_response.

◆ get_response_schema()

static core\router\response\exception_response::get_response_schema ( )
staticprotected

Get the schema for the response.

Return values
schema_object

◆ get_schema_from_type()

core\router\schema\openapi_base::get_schema_from_type ( param $type)
inherited

Get the schema for a given type.

Parameters
param$type
Return values
stdClass

◆ get_status_code()

core\router\schema\response\response::get_status_code ( )
inherited

Get the status code for this response.

Return values
int

◆ validate()

core\router\schema\response\response::validate ( ResponseInterface $response)
inherited

Validate the response.

Parameters
ResponseInterface$responseThe response to validate

The documentation for this class was generated from the following file: