\phpWTLExtendedDataRetriever

Data retriever for the extended log file format.

Summary

Methods
Properties
Constants
retrieveField()
retrieve()
setFieldContent()
getDataRetrievalPolicies()
setDataRetrievalPolicies()
getUrlOrigin()
getInstance()
No public properties found
No constants found
__clone()
__sleep()
__wakeup()
__construct()
$loggerContent
$fieldDescriptor
$retrievalPolicies
$_instance
N/A
No private methods found
No private properties found
N/A

Properties

$loggerContent

$loggerContent : 

Type

$fieldDescriptor

$fieldDescriptor : 

Type

$retrievalPolicies

$retrievalPolicies : 

Type

$_instance

$_instance : 

Array to hold instances of all derived classes.

Type

Methods

retrieveField()

retrieveField(string  $field_name, string  $value = null) 

Retrieve data for a single log field and store it in the associated LoggerContent object.

Parameters

string $field_name

ID of log format field.

string $value

Provide an (optional) value to pass thru to the LoggerContent object, so allowing for the injection of external data.

retrieve()

retrieve() 

Retrieve data for all log fields and store it in the LoggerContent object.

setFieldContent()

setFieldContent(string  $field_name, string  $value) 

Set content for a single log field and store it in the associated LoggerContent object.

Parameters

string $field_name

ID of log format field.

string $value

Data to store.

getDataRetrievalPolicies()

getDataRetrievalPolicies() : array

Returns

array —

Get array of DataRetrievalPolicy objects.

setDataRetrievalPolicies()

setDataRetrievalPolicies(array  $retrievalPolicies) 

Parameters

array $retrievalPolicies

Array of DataRetrievalPolicy objects.

getUrlOrigin()

getUrlOrigin(boolean  $use_forwarded_host = false) : string

Helper method to build complete URLs (might serve as an URI "prefix" providing protocol, ip-adress and port).

Parameters

boolean $use_forwarded_host

Resolve host with the HTTP_X_FORWARDED_HOST (proxy) method (default is false).

Returns

string —

URL origin, format: xyz://x.x.x.x:x/.

getInstance()

getInstance(array|mixed|null  $inject = null) : \phpWTL\$_instance[$class]

Create new instance or give back already existing one.

Parameters

array|mixed|null $inject

Can be used to inject one or more parameter(s) into the constructor

Returns

\phpWTL\$_instance[$class] —

The instance of a derived class

__clone()

__clone() 

Disable cloning for singleton.

Throws

\phpWTL\Exception

if called

__sleep()

__sleep() 

Disable serialization for singleton.

Throws

\phpWTL\Exception

if called

__wakeup()

__wakeup() 

Disable de-serialization for singleton.

Throws

\phpWTL\Exception

if called

__construct()

__construct(array  $inject = null) 

Parameters

array $inject

Array containing objects for LoggerContent [0] and RetrievalPolicies [1] (may be null). The FieldDescriptor is derived from the LoggerContent object.