PHP 클래스 Drest\Mapping\RouteMetaData

저자: Lee
상속: implements Serializable
파일 보기 프로젝트 열기: leedavis81/drest 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$allowed_option_request integer Whether this route is open to allow OPTION requests to detail available $verbs -1 = not set 0 = not allowed 1 = allowed
$class_metadata Drest\Mapping\ClassMetaData This route objects parent
$collection boolean Whether get requests to this route should be exposed / handled as collections
$disable_expose boolean Prevent expose settings lookup
$expose array An array of fields to be exposed to the end client
$handle_call string A handle function call for this route (if one is configured)
$name string The route name (must be unique)
$param_names array Key-value array of URL parameter names
$param_names_path array Key-value array of URL parameters with + at the end
$route_conditions array Eg array('year' => '(19|20)\d\d')
$route_params array Key-value array of URL parameters populated after a match has been successful - or directly by using available setter
$route_pattern string A string route pattern to be matched on. eg /user/:id
$unmapped_route_params array The value id => 1 will go into $route_params All the rest will go in here.
$verbs array They match the constant values defined in DrestCommon\Request\Request eg array('GET', 'POST')

공개 메소드들

메소드 설명
getClassMetaData ( ) : Drest\Mapping\ClassMetaData Get this classes metadata object
getExpose ( ) : array Get the field exposure on this route
getHandleCall ( ) : string Get the handle call function
getName ( ) : string Get the name of this route
getNamedRoute ( ) : string The unique named route to reference this route by Note that is should use the entities fully qualified class names
getOriginLocation ( object $object, string $url, EntityManager $em = null ) : string | false Generate the location string from the provided object
getRouteConditions ( ) : array | null Get the route conditions
getRouteParams ( ) : array Get any params that were set after a successful match
getRoutePattern ( ) : string Get this routes route pattern
getVerbs ( ) : array Get an array of verbs that are allowed on this route
hasHandleCall ( ) Does this route have an annotated handle call
isAllowedOptionRequest ( ) : integer Is this route allowed to expose its verbs to OPTIONS requests
isCollection ( ) Should this route be handled as a collection
isExposeDisabled ( ) : boolean Is the expose lookup disabled
matches ( DrestCommon\Request\Request $request, boolean $matchVerb = true, string $basePath = null ) : boolean Does this request match the route pattern
needsHandleCall ( ) : boolean Does this route need a handle call? Required for POST/PUT/PATCH verbs
serialize ( ) : string Serialise this object
setAllowedOptionRequest ( integer | boolean $value = true ) Set whether we would like to expose this route (and its verbs) to OPTIONS requests
setClassMetaData ( Drest\Mapping\ClassMetaData $class_metadata ) Set this objects parent metadata class
setCollection ( boolean $value = true ) Whether requests to this route should be handled as collections
setDisableExpose ( boolean $flag = true ) Set disable expose flag
setExpose ( array $expose ) An array of fields we're allowed to expose to the client
setHandleCall ( string $handle_call ) Set the handle function call
setName ( string $name ) Sets a unique reference name for the resource.
setRouteConditions ( array $route_conditions ) Add an array of route conditions
setRouteParams ( array $params = [] ) Inject route params onto this object without performing a match. Useful when calling a named route directly
setRoutePattern ( string $route_pattern ) Add the route path. eg '/users/:id'
setUnmappedRouteParams ( array $params = [] ) Inject unmapped route params onto this object without performing a match.
setVerbs ( mixed $verbs ) Add verbs that are to be allowed on this route.
unserialize ( string $string ) Un-serialise this object and reestablish it's state
usesHttpVerbs ( ) Is this route specific to defined HTTP verbs

메소드 상세

getClassMetaData() 공개 메소드

Get this classes metadata object
public getClassMetaData ( ) : Drest\Mapping\ClassMetaData
리턴 Drest\Mapping\ClassMetaData $class_metadata

getExpose() 공개 메소드

Get the field exposure on this route
public getExpose ( ) : array
리턴 array $expose

getHandleCall() 공개 메소드

Get the handle call function
public getHandleCall ( ) : string
리턴 string $handle_call

getName() 공개 메소드

Get the name of this route
public getName ( ) : string
리턴 string $name

getNamedRoute() 공개 메소드

The unique named route to reference this route by Note that is should use the entities fully qualified class names
public getNamedRoute ( ) : string
리턴 string

getOriginLocation() 공개 메소드

Generate the location string from the provided object
public getOriginLocation ( object $object, string $url, EntityManager $em = null ) : string | false
$object object
$url string - the Url to be prepended to the location
$em Doctrine\ORM\EntityManager - Optionally pass the entity manager to assist in determining a GET origin location
리턴 string | false

getRouteConditions() 공개 메소드

Get the route conditions
public getRouteConditions ( ) : array | null
리턴 array | null

getRouteParams() 공개 메소드

Get any params that were set after a successful match
public getRouteParams ( ) : array
리턴 array $params

getRoutePattern() 공개 메소드

Get this routes route pattern
public getRoutePattern ( ) : string
리턴 string $route_pattern

getVerbs() 공개 메소드

Get an array of verbs that are allowed on this route
public getVerbs ( ) : array
리턴 array

hasHandleCall() 공개 메소드

Does this route have an annotated handle call
public hasHandleCall ( )

isAllowedOptionRequest() 공개 메소드

Is this route allowed to expose its verbs to OPTIONS requests
public isAllowedOptionRequest ( ) : integer
리턴 integer $result -1 if not set, 0 if no and 1 if yes

isCollection() 공개 메소드

Should this route be handled as a collection
public isCollection ( )

isExposeDisabled() 공개 메소드

Is the expose lookup disabled
public isExposeDisabled ( ) : boolean
리턴 boolean

matches() 공개 메소드

Does this request match the route pattern
public matches ( DrestCommon\Request\Request $request, boolean $matchVerb = true, string $basePath = null ) : boolean
$request DrestCommon\Request\Request
$matchVerb boolean - Whether you want to match the route using the request HTTP verb - useful for OPTIONS requests to provide route info
$basePath string - add a base path to the route pattern
리턴 boolean $result

needsHandleCall() 공개 메소드

Does this route need a handle call? Required for POST/PUT/PATCH verbs
public needsHandleCall ( ) : boolean
리턴 boolean $response

serialize() 공개 메소드

Serialise this object
public serialize ( ) : string
리턴 string

setAllowedOptionRequest() 공개 메소드

Set whether we would like to expose this route (and its verbs) to OPTIONS requests
public setAllowedOptionRequest ( integer | boolean $value = true )
$value integer | boolean - if using integer -1 to unset, 0 for no and 1 if yes

setClassMetaData() 공개 메소드

Set this objects parent metadata class
public setClassMetaData ( Drest\Mapping\ClassMetaData $class_metadata )
$class_metadata Drest\Mapping\ClassMetaData

setCollection() 공개 메소드

Whether requests to this route should be handled as collections
public setCollection ( boolean $value = true )
$value boolean

setDisableExpose() 공개 메소드

Set disable expose flag
public setDisableExpose ( boolean $flag = true )
$flag boolean

setExpose() 공개 메소드

An array of fields we're allowed to expose to the client
public setExpose ( array $expose )
$expose array

setHandleCall() 공개 메소드

Set the handle function call
public setHandleCall ( string $handle_call )
$handle_call string

setName() 공개 메소드

If other resources are created with this name an exception is thrown (must be unique)
public setName ( string $name )
$name string

setRouteConditions() 공개 메소드

Add an array of route conditions
public setRouteConditions ( array $route_conditions )
$route_conditions array

setRouteParams() 공개 메소드

Inject route params onto this object without performing a match. Useful when calling a named route directly
public setRouteParams ( array $params = [] )
$params array - should be an associative array. keyed values are ignored

setRoutePattern() 공개 메소드

Add the route path. eg '/users/:id'
public setRoutePattern ( string $route_pattern )
$route_pattern string

setUnmappedRouteParams() 공개 메소드

Useful when calling a named route directly
public setUnmappedRouteParams ( array $params = [] )
$params array - should be a keyed array. associative values are ignored

setVerbs() 공개 메소드

Add verbs that are to be allowed on this route.
public setVerbs ( mixed $verbs )
$verbs mixed = a single or array of verbs valid for this route. eg array('GET', 'PUT')

unserialize() 공개 메소드

Un-serialise this object and reestablish it's state
public unserialize ( string $string )
$string string

usesHttpVerbs() 공개 메소드

Is this route specific to defined HTTP verbs
public usesHttpVerbs ( )

프로퍼티 상세

$allowed_option_request 보호되어 있는 프로퍼티

Whether this route is open to allow OPTION requests to detail available $verbs -1 = not set 0 = not allowed 1 = allowed
protected int $allowed_option_request
리턴 integer

$class_metadata 보호되어 있는 프로퍼티

This route objects parent
protected ClassMetaData,Drest\Mapping $class_metadata
리턴 Drest\Mapping\ClassMetaData

$collection 보호되어 있는 프로퍼티

Whether get requests to this route should be exposed / handled as collections
protected bool $collection
리턴 boolean

$disable_expose 보호되어 있는 프로퍼티

Prevent expose settings lookup
protected bool $disable_expose
리턴 boolean

$expose 보호되어 있는 프로퍼티

An array of fields to be exposed to the end client
protected array $expose
리턴 array

$handle_call 보호되어 있는 프로퍼티

A handle function call for this route (if one is configured)
protected string $handle_call
리턴 string

$name 보호되어 있는 프로퍼티

The route name (must be unique)
protected string $name
리턴 string

$param_names 보호되어 있는 프로퍼티

Key-value array of URL parameter names
protected array $param_names
리턴 array

$param_names_path 보호되어 있는 프로퍼티

Key-value array of URL parameters with + at the end
protected array $param_names_path
리턴 array

$route_conditions 보호되어 있는 프로퍼티

Eg array('year' => '(19|20)\d\d')
protected array $route_conditions
리턴 array

$route_params 보호되어 있는 프로퍼티

Key-value array of URL parameters populated after a match has been successful - or directly by using available setter
protected array $route_params
리턴 array

$route_pattern 보호되어 있는 프로퍼티

A string route pattern to be matched on. eg /user/:id
protected string $route_pattern
리턴 string

$unmapped_route_params 보호되어 있는 프로퍼티

The value id => 1 will go into $route_params All the rest will go in here.
protected array $unmapped_route_params
리턴 array

$verbs 보호되어 있는 프로퍼티

They match the constant values defined in DrestCommon\Request\Request eg array('GET', 'POST')
protected array $verbs
리턴 array