class RelativePath extends PropertyPath
SINGULAR_SEPARATOR | Character used for separating between plural and singular of an element. |
__construct(FormInterface $root, PropertyPath|string $propertyPath) Constructs a property path from a string. | ||
string | __toString() Returns the string representation of the property path. | from PropertyPath |
int | getLength() Returns the length of the property path, i.e. the number of elements. | from PropertyPath |
PropertyPath | getParent() Returns the parent property path. | from PropertyPath |
PropertyPathIteratorInterface | getIterator() Returns a new iterator for this path. | from PropertyPath |
array | getElements() Returns the elements of the property path as array. | from PropertyPath |
string | getElement(int $index) Returns the element at the given index in the property path. | from PropertyPath |
bool | isProperty(int $index) Returns whether the element at the given index is a property. | from PropertyPath |
bool | isIndex(int $index) Returns whether the element at the given index is an array index. | from PropertyPath |
FormInterface | getRoot() |
Constructs a property path from a string.
FormInterface | $root | |
PropertyPath|string | $propertyPath | The property path as string or instance |
InvalidArgumentException | If the given path is not a string |
InvalidPropertyPathException | If the syntax of the property path is not valid |
Returns the string representation of the property path.
string | The path as string |
Returns the length of the property path, i.e. the number of elements.
int | The path length |
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.
PropertyPath | The parent path or null |
Returns a new iterator for this path.
PropertyPathIteratorInterface |
Returns the elements of the property path as array.
array | An array of property/index names |
Returns the element at the given index in the property path.
int | $index | The index key |
string | A property or index name |
OutOfBoundsException | If the offset is invalid |
Returns whether the element at the given index is a property.
int | $index | The index in the property path |
bool | Whether the element at this index is a property |
OutOfBoundsException | If the offset is invalid |
Returns whether the element at the given index is an array index.
int | $index | The index in the property path |
bool | Whether the element at this index is an array index |
OutOfBoundsException | If the offset is invalid |
FormInterface |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Component/Form/Extension/Validator/ViolationMapper/RelativePath.html