\Symfony\Component\PropertyAccessPropertyPathInterface

A sequence of property names or array indices.

Summary

Methods
Constants
__toString()
getLength()
getParent()
getElements()
getElement()
isProperty()
isIndex()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

__toString()

__toString() : string

Returns the string representation of the property path.

Returns

string —

The path as string

getLength()

getLength() : int

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

Returns

int —

The path length

getParent()

getParent() : self|null

Returns the parent property path.

The parent property path is the one that contains the same items as this one except for the last one.

If this property path only contains one item, null is returned.

Returns

self|null —

The parent path or null

getElements()

getElements() : array

Returns the elements of the property path as array.

Returns

array —

An array of property/index names

getElement()

getElement(int  $index) : string

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

Parameters

int $index

The index key

Throws

\Symfony\Component\PropertyAccess\Exception\OutOfBoundsException

If the offset is invalid

Returns

string —

A property or index name

isProperty()

isProperty(int  $index) : bool

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

Parameters

int $index

The index in the property path

Throws

\Symfony\Component\PropertyAccess\Exception\OutOfBoundsException

If the offset is invalid

Returns

bool —

Whether the element at this index is a property

isIndex()

isIndex(int  $index) : bool

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

Parameters

int $index

The index in the property path

Throws

\Symfony\Component\PropertyAccess\Exception\OutOfBoundsException

If the offset is invalid

Returns

bool —

Whether the element at this index is an array index