Documentation

PropertyPathBuilder
in package

Tags
author

Bernhard Schussek bschussek@gmail.com

Table of Contents

Properties

$elements  : mixed
$isIndex  : mixed

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

Methods

__toString()

Returns the current property path as string.

public __toString() : string
Return values
string

append()

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
int

remove()

Removes elements from the current path.

public remove(int $offset[, int $length = 1 ]) : mixed
Parameters
$offset : int
$length : int = 1
Tags
throws
OutOfBoundsException

if offset is invalid

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

If the offset is invalid

replaceByIndex()

Replaces a property element by an index element.

public replaceByIndex(int $offset[, string $name = null ]) : mixed
Parameters
$offset : int
$name : string = null
Tags
throws
OutOfBoundsException

If the offset is invalid

replaceByProperty()

Replaces an index element by a property element.

public replaceByProperty(int $offset[, string $name = null ]) : mixed
Parameters
$offset : int
$name : string = null
Tags
throws
OutOfBoundsException

If the offset is invalid

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

        
On this page

Search results