class RelativePath extends PropertyPath

Constants

SINGULAR_SEPARATOR

Character used for separating between plural and singular of an element.

Methods

__construct(FormInterface $root, PropertyPath|string $propertyPath)

No description

string
__toString()

Returns the string representation of the property path

integer
getLength()

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

getParent()

Returns the parent property path.

getIterator()

Returns a new iterator for this path

array
getElements()

Returns the elements of the property path as array

string
getElement(integer $index)

Returns the element at the given index in the property path

Boolean
isProperty(integer $index)

Returns whether the element at the given index is a property

Boolean
isIndex(integer $index)

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

getRoot()

No description

Details

at line line 31
__construct(FormInterface $root, PropertyPath|string $propertyPath)

Parameters

FormInterface $root
PropertyPath|string $propertyPath The property path as string or instance

in PropertyPath at line line 139
string __toString()

Returns the string representation of the property path

Return Value

string The path as string

in PropertyPath at line line 147
integer getLength()

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

Return Value

integer The path length

in PropertyPath at line line 155
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.

Return Value

PropertyPath The parent path or null

in PropertyPath at line line 177
PropertyPathIteratorInterface getIterator()

Returns a new iterator for this path

in PropertyPath at line line 185
array getElements()

Returns the elements of the property path as array

Return Value

array An array of property/index names

in PropertyPath at line line 193
string getElement(integer $index)

Returns the element at the given index in the property path

Parameters

integer $index The index key

Return Value

string A property or index name

Exceptions

OutOfBoundsException If the offset is invalid

in PropertyPath at line line 205
Boolean isProperty(integer $index)

Returns whether the element at the given index is a property

Parameters

integer $index The index in the property path

Return Value

Boolean Whether the element at this index is a property

Exceptions

OutOfBoundsException If the offset is invalid

in PropertyPath at line line 217
Boolean isIndex(integer $index)

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

Parameters

integer $index The index in the property path

Return Value

Boolean Whether the element at this index is an array index

Exceptions

OutOfBoundsException If the offset is invalid

at line line 41
FormInterface getRoot()

Return Value

FormInterface