Documentation

PropertyPathInterface extends Traversable

A sequence of property names or array indices.

Tags
author

Bernhard Schussek bschussek@gmail.com

extends

\Traversable<int, string>

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
string

getElement()

Returns the element at the given index in the property path.

public getElement(int $index) : string
Parameters
$index : int

The index key

Tags
throws
OutOfBoundsException

If the offset is invalid

Return values
string

getElements()

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
int

getParent()

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|null

isIndex()

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
throws
OutOfBoundsException

If the offset is invalid

Return values
bool

isProperty()

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

Tags
throws
OutOfBoundsException

If the offset is invalid

Return values
bool

        
On this page

Search results