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
__construct(PropertyPath|string $propertyPath) Constructs a property path from a string. | ||
string | __toString() Returns the string representation of the property path. | |
int | getLength() Returns the length of the property path, i.e. the number of elements. | |
PropertyPath | getParent() Returns the parent property path. | |
PropertyPathIteratorInterface | getIterator() Returns a new iterator for this path. | |
array | getElements() Returns the elements of the property path as array. | |
string | getElement(int $index) Returns the element at the given index in the property path. | |
bool | isProperty(int $index) Returns whether the element at the given index is a property. | |
bool | isIndex(int $index) Returns whether the element at the given index is an array index. |
Details
__construct(PropertyPath|string $propertyPath)
Constructs a property path from a string.
string __toString()
Returns the string representation of the property path.
int getLength()
Returns the length of the property path, i.e. the number of elements.
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.
PropertyPathIteratorInterface getIterator()
Returns a new iterator for this path.
array getElements()
Returns the elements of the property path as array.
string getElement(int $index)
Returns the element at the given index in the property path.
bool isProperty(int $index)
Returns whether the element at the given index is a property.
bool isIndex(int $index)
Returns whether the element at the given index is an array index.
Please login to continue.