mediatekformation

ViolationPath
in package
implements IteratorAggregate, PropertyPathInterface

Tags
author

Bernhard Schussek bschussek@gmail.com

Interfaces, Classes, Traits and Enums

IteratorAggregate
PropertyPathInterface
A sequence of property names or array indices.

Table of Contents

$elements  : array<string|int, mixed>
$isIndex  : array<string|int, mixed>
$length  : int
$mapsForm  : array<string|int, mixed>
$pathAsString  : string
__construct()  : mixed
Creates a new violation path from a string.
__toString()  : string
Returns the string representation of the property path.
getElement()  : string
Returns the element at the given index in the property path.
getElements()  : array<string|int, mixed>
Returns the elements of the property path as array.
getIterator()  : ViolationPathIterator
Returns a new iterator for this path.
getLength()  : int
Returns the length of the property path, i.e. the number of elements.
getParent()  : self|null
Returns the parent property path.
isIndex()  : bool
Returns whether the element at the given index is an array index.
isProperty()  : bool
Returns whether the element at the given index is a property.
mapsForm()  : bool
Returns whether an element maps directly to a form.
buildString()  : mixed
Builds the string representation from the elements.

Properties

Methods

__construct()

Creates a new violation path from a string.

public __construct(string $violationPath) : mixed
Parameters
$violationPath : string

The property path of a object

Return values
mixed

__toString()

Returns the string representation of the property path.

public __toString() : string
Return values
string

The path as string

getElement()

Returns the element at the given index in the property path.

public getElement(mixed $index) : string
Parameters
$index : mixed

The index key

Return values
string

A property or index name

getElements()

Returns the elements of the property path as array.

public getElements() : array<string|int, mixed>
Return values
array<string|int, mixed>

An array of property/index names

getLength()

Returns the length of the property path, i.e. the number of elements.

public getLength() : int
Return values
int

The path length

getParent()

Returns the parent property path.

public getParent() : self|null
Return values
self|null

The parent path or null

isIndex()

Returns whether the element at the given index is an array index.

public isIndex(mixed $index) : bool
Parameters
$index : mixed

The index in the property path

Return values
bool

Whether the element at this index is an array index

isProperty()

Returns whether the element at the given index is a property.

public isProperty(mixed $index) : bool
Parameters
$index : mixed

The index in the property path

Return values
bool

Whether the element at this index is a property

mapsForm()

Returns whether an element maps directly to a form.

public mapsForm(int $index) : bool

Consider the following violation path:

children[address].children[office].data.street

In this example, "address" and "office" map to forms, while "street does not.

Parameters
$index : int

The element index

Tags
throws
OutOfBoundsException

if the offset is invalid

Return values
bool

Whether the element maps to a form

buildString()

Builds the string representation from the elements.

private buildString() : mixed
Return values
mixed

Search results