\r\n

51Degrees Pipeline PHP  4.4

51Degrees Pipeline for PHP

fiftyone\pipeline\core\SetHeaderElement Class Reference

Detailed Description

Set response headers element class.

This is used to get response headers based on what the browser supports. For example, newer Chrome browsers support the Accept-CH header.

Inheritance diagram for fiftyone\pipeline\core\SetHeaderElement:

[legend]

Collaboration diagram for fiftyone\pipeline\core\SetHeaderElement:

[legend]

Public Member Functions

 processInternal (FlowData $flowData)
Add the response header dictionary to the FlowData.
 getSetHeaderPropertiesPipeline (Pipeline $pipeline)
Get All the properties starting with SetHeader string from pipeline. More...
 getResponseHeaderValue (FlowData $flowData, array $setHeaderPropertiesDict)
Get response header value using set header properties from FlowData. More...
 getPropertyValue (FlowData $flowData, string $elementKey, string $propertyKey)
Try to get the value for the given element and property. More...
 getResponseHeaderName (string $propertyKey)
Determines which response header the property value will be appended to by stripping the 'SetHeader' string and the 'Component Name' from the property name. More...

Public Member Functions inherited from fiftyone\pipeline\core\FlowElement

 __construct ()
A default dummy constructor is needed for there are classes inheriting this class deeper than 1-level of inheritance and calling parent::__construct() in their explicit constructors. More...
 process (FlowData $flowData)
General wrapper function that calls a FlowElement's processInternal method.
 getEvidenceKeyFilter ()
Function for getting the FlowElement's EvidenceKeyFilter Used by the filterEvidence method.
 filterEvidence (FlowData $flowData)
Filter FlowData evidence using the FlowElement's EvidenceKeyFilter. More...
 filterEvidenceKey (string $key)
Filter FlowData evidence using the FlowElement's EvidenceKeyFilter.
 onRegistration (Pipeline $pipeline)
Callback called when an engine is added to a pipeline.
 processInternal (FlowData $flowData)
Process FlowData - this is process function is usually overridden by specific FlowElements to do their core work.
 getProperties ()
Get properties Usually overridden by specific FlowElements. More...
 updatePropertyList ()
Update a FlowElement's property list This is used by elements that are only aware of their properties at a later stage, such as cloud request based FlowElements or FlowElements that change their properties later based on new datafiles.

Data Fields

string  $dataKey = 'set-headers'

Data Fields inherited from fiftyone\pipeline\core\FlowElement

string  $dataKey
array  $properties = []
array  $pipelines = []

Member Function Documentation

◆ getPropertyValue()

fiftyone\pipeline\core\SetHeaderElement::getPropertyValue ( FlowData   $flowData,
string   $elementKey,
string   $propertyKey  
)

Try to get the value for the given element and property.

If the value cannot be found or is null/unknown, then an empty string will be returned.

Parameters
\fiftyone\pipeline\core\FlowData
$flowData - A processed FlowData instance to get the value from
string
$elementKey - Key for the element data to get the value from
string
$propertyKey - name of the property to get the value for

@phpstan-var null|\fiftyone\pipeline\core\AspectPropertyValue $property

◆ getResponseHeaderName()

fiftyone\pipeline\core\SetHeaderElement::getResponseHeaderName ( string   $propertyKey )

Determines which response header the property value will be appended to by stripping the 'SetHeader' string and the 'Component Name' from the property name.

Parameters
string
$propertyKey - Key for SetHeaderAcceptCH property
Returns
string Response header name
Exceptions
-

@phpstan-var array<string> $parts

◆ getResponseHeaderValue()

fiftyone\pipeline\core\SetHeaderElement::getResponseHeaderValue ( FlowData   $flowData,
array   $setHeaderPropertiesDict  
)

Get response header value using set header properties from FlowData.

Parameters
\fiftyone\pipeline\core\FlowData
$flowData - A processed FlowData object containing setheader properties
array<string,array<int,mixed>> - $setHeaderPropertiesDict A processed FlowData object containing setheader properties
Returns
array<string, string> A dictionary object containing SetHeader properties list against flowElement

◆ getSetHeaderPropertiesPipeline()

fiftyone\pipeline\core\SetHeaderElement::getSetHeaderPropertiesPipeline ( Pipeline   $pipeline )

Get All the properties starting with SetHeader string from pipeline.

Returns
array<string, array<int, mixed>> A dictionary object containing SetHeader properties list against flowElement
On This Page