PropertyPathBuilder
in package
Tags
Table of Contents
Properties
Methods
- __construct() : mixed
- __toString() : string
- Returns the current property path as string.
- append() : mixed
- Appends a (sub-) path to the current path.
- appendIndex() : mixed
- Appends an index element to the current path.
- appendProperty() : mixed
- Appends a property element to the current path.
- getLength() : int
- Returns the length of the current path.
- getPropertyPath() : PropertyPathInterface|null
- Returns the current property path.
- remove() : mixed
- Removes elements from the current path.
- replace() : mixed
- Replaces a sub-path by a different (sub-) path.
- replaceByIndex() : mixed
- Replaces a property element by an index element.
- replaceByProperty() : mixed
- Replaces an index element by a property element.
- resize() : mixed
- Resizes the path so that a chunk of length $cutLength is removed at $offset and another chunk of length $insertionLength can be inserted.
Properties
$elements
private
mixed
$elements
= []
$isIndex
private
mixed
$isIndex
= []
Methods
__construct()
public
__construct([PropertyPathInterface|string $path = null ]) : mixed
Parameters
- $path : PropertyPathInterface|string = null
__toString()
Returns the current property path as string.
public
__toString() : string
Return values
stringappend()
Appends a (sub-) path to the current path.
public
append(PropertyPathInterface|string $path[, int $offset = 0 ][, int $length = 0 ]) : mixed
Parameters
- $path : PropertyPathInterface|string
- $offset : int = 0
-
The offset where the appended piece starts in $path
- $length : int = 0
-
The length of the appended piece; if 0, the full path is appended
appendIndex()
Appends an index element to the current path.
public
appendIndex(string $name) : mixed
Parameters
- $name : string
appendProperty()
Appends a property element to the current path.
public
appendProperty(string $name) : mixed
Parameters
- $name : string
getLength()
Returns the length of the current path.
public
getLength() : int
Return values
intgetPropertyPath()
Returns the current property path.
public
getPropertyPath() : PropertyPathInterface|null
Return values
PropertyPathInterface|nullremove()
Removes elements from the current path.
public
remove(int $offset[, int $length = 1 ]) : mixed
Parameters
- $offset : int
- $length : int = 1
Tags
replace()
Replaces a sub-path by a different (sub-) path.
public
replace(int $offset, int $length, PropertyPathInterface|string $path[, int $pathOffset = 0 ][, int $pathLength = 0 ]) : mixed
Parameters
- $offset : int
- $length : int
- $path : PropertyPathInterface|string
- $pathOffset : int = 0
-
The offset where the inserted piece starts in $path
- $pathLength : int = 0
-
The length of the inserted piece; if 0, the full path is inserted
Tags
replaceByIndex()
Replaces a property element by an index element.
public
replaceByIndex(int $offset[, string $name = null ]) : mixed
Parameters
- $offset : int
- $name : string = null
Tags
replaceByProperty()
Replaces an index element by a property element.
public
replaceByProperty(int $offset[, string $name = null ]) : mixed
Parameters
- $offset : int
- $name : string = null
Tags
resize()
Resizes the path so that a chunk of length $cutLength is removed at $offset and another chunk of length $insertionLength can be inserted.
private
resize(int $offset, int $cutLength, int $insertionLength) : mixed
Parameters
- $offset : int
- $cutLength : int
- $insertionLength : int