Properties

$formatFields

$formatFields : 

Type

$formatPrefix

$formatPrefix : 

Type

$formatVersion

$formatVersion : 

Type

$formatFieldDelimiter

$formatFieldDelimiter : 

Type

$_instance

$_instance : 

Array to hold instances of all derived classes.

Type

Methods

getFieldNames()

getFieldNames(  $default = \phpWTL\FormatDescriptorHelper::DEFAULT_ONLY) : array

Parameters

$default

lists all or only fields (not) flagged as default

Returns

array —

Get array containing all log format field IDs in their proper sequence.

getMetaFieldNames()

getMetaFieldNames(  $default = \phpWTL\FormatDescriptorHelper::DEFAULT_ONLY) : array

Parameters

$default

lists all or only fields (not) flagged as default

Returns

array —

Get array containing all log format meta field IDs in their proper sequence.

getRegularFieldNames()

getRegularFieldNames(  $default = \phpWTL\FormatDescriptorHelper::DEFAULT_ONLY) : array

Parameters

$default

lists all or only fields (not) flagged as default

Returns

array —

Get array containing all regular (non-meta) log format field IDs in their proper sequence.

getFieldData()

getFieldData(string  $data, array  $names = null) : array

Parameters

string $data

Attribute to retrieve

array $names

Array of field names (IDs)

Returns

array —

Get associative array containing all log format field data for a given list and attribute in their proper sequence.

getFieldDescription()

getFieldDescription(string  $field_name) : object

Parameters

string $field_name

ID of log format field.

Returns

object —

DescriptorField.

getFieldAttributeNames()

getFieldAttributeNames() : array

Returns

array —

Get array of all DescriptorField attribute names: name, prefix, suffix, formatter, validator, datatype.

getFieldAttribute()

getFieldAttribute(string  $field_name, string  $attribute_name) : string

Parameters

string $field_name

ID of log format field.

string $attribute_name

Name of the DescriptorField attribute.

Returns

string —

Value of the DescriptorField attribute for the desired field ID.

setFieldAttribute()

setFieldAttribute(string  $field_name, string  $attribute_name, string  $value) 

Parameters

string $field_name

ID of log format field.

string $attribute_name

Name of the DescriptorField attribute ("name", because it serves as an ID, is immutable).

string $value

Value to assign the DescriptorField attribute for the desired field ID.

getFormatPrefix()

getFormatPrefix() : string

Returns

string —

Prefix (ID) for the log format this descriptor class represents, suffixed by an underscore.

getFormatFieldDelimiter()

getFormatFieldDelimiter() : string

Returns

string —

Line delimiter for a "toString-like" representation of all format fields content.

getFormatVersion()

getFormatVersion() : string

Returns

string —

Version for the log format this descriptor class represents.

getCaption()

getCaption(  $field_name) 

Parameters

$field_name

getPrefix()

getPrefix(  $field_name) 

Parameters

$field_name

getSuffix()

getSuffix(  $field_name) 

Parameters

$field_name

getFormatter()

getFormatter(  $field_name) 

Parameters

$field_name

getValidator()

getValidator(  $field_name) 

Parameters

$field_name

getDatatypeRaw()

getDatatypeRaw(  $field_name) 

Parameters

$field_name

getDatatypeFormatted()

getDatatypeFormatted(  $field_name) 

Parameters

$field_name

isDefault()

isDefault(  $field_name) 

Parameters

$field_name

isMeta()

isMeta(  $field_name) 

Parameters

$field_name

setCaption()

setCaption(  $field_name,   $value) 

Parameters

$field_name
$value

setPrefix()

setPrefix(  $field_name,   $value) 

Parameters

$field_name
$value

setSuffix()

setSuffix(  $field_name,   $value) 

Parameters

$field_name
$value

setFormatter()

setFormatter(  $field_name,   $value) 

Parameters

$field_name
$value

setValidator()

setValidator(  $field_name,   $value) 

Parameters

$field_name
$value

setDatatypeRaw()

setDatatypeRaw(  $field_name,   $value) 

Parameters

$field_name
$value

setDatatypeFormatted()

setDatatypeFormatted(  $field_name,   $value) 

Parameters

$field_name
$value

setDefault()

setDefault(  $field_name,   $on = true) 

Parameters

$field_name
$on

setMeta()

setMeta(  $field_name,   $on = true) 

Parameters

$field_name
$on

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(object|null  $inject = null) 

Set format prefix and create all format field descriptors in their proper sequence (array of DescriptorField objects):

timestamp, message, loglevel_caption, loglevel, context_data

Parameters

object|null $inject

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