PropertyPathInterface
extends
Traversable
in
A sequence of property names or array indices.
Tags
Table of Contents
Methods
- __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<int, string>
- Returns the elements of the property path as array.
- 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.
Methods
__toString()
Returns the string representation of the property path.
public
__toString() : string
Return values
stringgetElement()
Returns the element at the given index in the property path.
public
getElement(int $index) : string
Parameters
- $index : int
-
The index key
Tags
Return values
stringgetElements()
Returns the elements of the property path as array.
public
getElements() : array<int, string>
Return values
array<int, string>getLength()
Returns the length of the property path, i.e. the number of elements.
public
getLength() : int
Return values
intgetParent()
Returns the parent property path.
public
getParent() : self|null
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.
Return values
self|nullisIndex()
Returns whether the element at the given index is an array index.
public
isIndex(int $index) : bool
Parameters
- $index : int
-
The index in the property path
Tags
Return values
boolisProperty()
Returns whether the element at the given index is a property.
public
isProperty(int $index) : bool
Parameters
- $index : int
-
The index in the property path