PHP Class Neos\Flow\Mvc\RequestMatcher

显示文件 Open project: neos/flow-development-collection Class Usage Examples

Protected Properties

Property Type Description
$parentMatcher RequestMatcher This property is set if parentRequest or mainRequest is used. The main purpose is to properly track the weight of the parentRequest and mainRequest Matchers through the addWeight method
$request ActionRequest If the Request is NULL this class will always return FALSE. This case is primarily needed if no parentRequest exists.
$weight integer The weight is a value that's added up through various matching functions in here. This is needed to have a way to determine, how specific a configuration Method is because that's how the configuration will be sorted.

Public Methods

Method Description
__construct ( ActionRequest $actionRequest = null, RequestMatcher $parentMatcher = null )
addWeight ( integer $weight ) : void Add a weight to the total
getMainRequest ( ) : RequestMatcher Get a new RequestMatcher for the Request's MainRequest
getParentRequest ( ) : RequestMatcher Get a new RequestMatcher for the Request's ParentRequest
getWeight ( ) : integer Return the current weight for this match
isAction ( string $action ) : boolean Check if the current Request's Action equals the argument
isController ( string $controller ) : boolean Check if the current Request's Controller equals the argument
isFormat ( string $format ) : boolean Check if the current Request's Format equals the argument
isPackage ( string $package ) : boolean Check if the current Request's Package equals the argument
isSubPackage ( string $subPackage ) : boolean Check if the current Request's SubPackage equals the argument
resetWeight ( ) : void Reset the match weight

Protected Methods

Method Description
matchRequestProperty ( string $propertyName, string $expectedValue, integer $weight ) : boolean Compare a request propertyValue against an expected value and add the weight if it's TRUE

Method Details

__construct() public method

public __construct ( ActionRequest $actionRequest = null, RequestMatcher $parentMatcher = null )
$actionRequest ActionRequest
$parentMatcher RequestMatcher

addWeight() public method

Add a weight to the total
public addWeight ( integer $weight ) : void
$weight integer
return void

getMainRequest() public method

Get a new RequestMatcher for the Request's MainRequest
public getMainRequest ( ) : RequestMatcher
return RequestMatcher

getParentRequest() public method

Get a new RequestMatcher for the Request's ParentRequest
public getParentRequest ( ) : RequestMatcher
return RequestMatcher

getWeight() public method

Return the current weight for this match
public getWeight ( ) : integer
return integer

isAction() public method

Check if the current Request's Action equals the argument
public isAction ( string $action ) : boolean
$action string
return boolean

isController() public method

Check if the current Request's Controller equals the argument
public isController ( string $controller ) : boolean
$controller string
return boolean

isFormat() public method

Check if the current Request's Format equals the argument
public isFormat ( string $format ) : boolean
$format string
return boolean

isPackage() public method

Check if the current Request's Package equals the argument
public isPackage ( string $package ) : boolean
$package string
return boolean

isSubPackage() public method

Check if the current Request's SubPackage equals the argument
public isSubPackage ( string $subPackage ) : boolean
$subPackage string
return boolean

matchRequestProperty() protected method

Compare a request propertyValue against an expected value and add the weight if it's TRUE
protected matchRequestProperty ( string $propertyName, string $expectedValue, integer $weight ) : boolean
$propertyName string
$expectedValue string
$weight integer
return boolean

resetWeight() public method

Reset the match weight
public resetWeight ( ) : void
return void

Property Details

$parentMatcher protected_oe property

This property is set if parentRequest or mainRequest is used. The main purpose is to properly track the weight of the parentRequest and mainRequest Matchers through the addWeight method
protected RequestMatcher,Neos\Flow\Mvc $parentMatcher
return RequestMatcher

$request protected_oe property

If the Request is NULL this class will always return FALSE. This case is primarily needed if no parentRequest exists.
protected ActionRequest,Neos\Flow\Mvc $request
return ActionRequest

$weight protected_oe property

The weight is a value that's added up through various matching functions in here. This is needed to have a way to determine, how specific a configuration Method is because that's how the configuration will be sorted.
protected int $weight
return integer