Moodle PHP Documentation 5.1
Moodle 5.1dev (Build: 20250620) (7d9030acd6e)
core\router\parameters\path_component Class Reference
Inheritance diagram for core\router\parameters\path_component:
core\router\schema\parameters\path_parameter core\router\schema\referenced_object core\router\schema\parameter core\router\schema\openapi_base

Public Member Functions

 __construct (string $name='component',... $extra,)
 Create a new path_component parameter.
 
 get_in ()
 Get the OpenAPI 'in' property.
 
 get_name ()
 Get the name of the parameter.
 
 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_type ()
 Fetch the underlying param.
 
 is_required (route $route)
 Check whether this parameter is required for the given route.
 
 validate (ServerRequestInterface $request, RoutingRoute $route,)
 Validate the path parameter.
 

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.
 

Public Attributes

string const IN_COOKIE = 'cookie'
 A cookie parameter.
 
string const IN_HEADER = 'header'
 A header parameter.
 
string const IN_PATH = 'path'
 A URI path parameter.
 
string const IN_QUERY = 'query'
 A query parameter.
 

Constructor & Destructor Documentation

◆ __construct()

core\router\parameters\path_component::__construct ( string $name = 'component',
... )

Create a new path_component parameter.

Parameters
string$nameThe name of the parameter to use for the component name
mixed...$extra Additional arguments

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_in()

core\router\schema\parameter::get_in ( )
inherited

Get the OpenAPI 'in' property.

Return values
string

◆ get_name()

core\router\schema\parameter::get_name ( )
inherited

Get the name of the parameter.

Return values
string

◆ get_openapi_description()

core\router\schema\parameters\path_parameter::get_openapi_description ( 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

Reimplemented from core\router\schema\parameter.

◆ 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_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_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_type()

core\router\schema\parameter::get_type ( )
inherited

Fetch the underlying param.

Return values
param

◆ is_required()

core\router\schema\parameters\path_parameter::is_required ( route $route)
inherited

Check whether this parameter is required for the given route.

Parameters
route$route
Return values
bool

Reimplemented from core\router\schema\parameter.

◆ validate()

core\router\schema\parameters\path_parameter::validate ( ServerRequestInterface $request,
RoutingRoute $route )
inherited

Validate the path parameter.

Parameters
ServerRequestInterface$request
RoutingRoute$route
Return values
ServerRequestInterfaceThe modified request with parameters updated

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