\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() : integer

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

Returns

integer —

The path length

getParent()

getParent() : \Symfony\Component\PropertyAccess\PropertyPath

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

\Symfony\Component\PropertyAccess\PropertyPath

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(integer  $index) : string

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

Parameters

integer $index

The index key

Throws

\Symfony\Component\PropertyAccess\Exception\OutOfBoundsException

If the offset is invalid

Returns

string —

A property or index name

isProperty()

isProperty(integer  $index) : boolean

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

Parameters

integer $index

The index in the property path

Throws

\Symfony\Component\PropertyAccess\Exception\OutOfBoundsException

If the offset is invalid

Returns

boolean —

Whether the element at this index is a property

isIndex()

isIndex(integer  $index) : boolean

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

Parameters

integer $index

The index in the property path

Throws

\Symfony\Component\PropertyAccess\Exception\OutOfBoundsException

If the offset is invalid

Returns

boolean —

Whether the element at this index is an array index