PropertyPath
class PropertyPath implements IteratorAggregate, PropertyPathInterface
Default implementation of {@link PropertyPathInterface}.
Constants
SINGULAR_SEPARATOR |
Character used for separating between plural and singular of an element. |
Methods
Returns the string representation of the property path.
Returns the length of the property path, i.e. the number of elements.
Returns the parent property path.
Returns a new iterator for this path.
Returns the elements of the property path as array.
Returns the element at the given index in the property path.
Returns whether the element at the given index is a property.
Returns whether the element at the given index is an array index.
Details
at line line 69
__construct(PropertyPath|string $propertyPath)
Constructs a property path from a string.
at line line 132
string
__toString()
Returns the string representation of the property path.
at line line 140
int
getLength()
Returns the length of the property path, i.e. the number of elements.
at line line 148
PropertyPath
getParent()
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.
at line line 169
PropertyPathIteratorInterface
getIterator()
Returns a new iterator for this path.
at line line 177
array
getElements()
Returns the elements of the property path as array.
at line line 185
string
getElement(int $index)
Returns the element at the given index in the property path.
at line line 197
bool
isProperty(int $index)
Returns whether the element at the given index is a property.
at line line 209
bool
isIndex(int $index)
Returns whether the element at the given index is an array index.