mediatekformation

PropertyPathBuilder
in package

Tags
author

Bernhard Schussek bschussek@gmail.com

Table of Contents

$elements  : mixed
$isIndex  : mixed
__construct()  : mixed
Creates a new property path builder.
__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

The property path as string

append()

Appends a (sub-) path to the current path.

public append(PropertyPathInterface|string $path, int $offset, int $length) : mixed
Parameters
$path : PropertyPathInterface|string

The path to append

$offset : int

The offset where the appended piece starts in $path

$length : int

The length of the appended piece If 0, the full path is appended

Return values
mixed

appendIndex()

Appends an index element to the current path.

public appendIndex(string $name) : mixed
Parameters
$name : string

The name of the appended index

Return values
mixed

appendProperty()

Appends a property element to the current path.

public appendProperty(string $name) : mixed
Parameters
$name : string

The name of the appended property

Return values
mixed

getLength()

Returns the length of the current path.

public getLength() : int
Return values
int

The path length

remove()

Removes elements from the current path.

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

The offset at which to remove

$length : int = 1

The length of the removed piece

Tags
throws
OutOfBoundsException

if offset is invalid

Return values
mixed

replace()

Replaces a sub-path by a different (sub-) path.

public replace(int $offset, int $length, PropertyPathInterface|string $path, int $pathOffset, int $pathLength) : mixed
Parameters
$offset : int

The offset at which to replace

$length : int

The length of the piece to replace

$path : PropertyPathInterface|string

The path to insert

$pathOffset : int

The offset where the inserted piece starts in $path

$pathLength : int

The length of the inserted piece If 0, the full path is inserted

Tags
throws
OutOfBoundsException

If the offset is invalid

Return values
mixed

replaceByIndex()

Replaces a property element by an index element.

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

The offset at which to replace

$name : string = null

The new name of the element. Optional

Tags
throws
OutOfBoundsException

If the offset is invalid

Return values
mixed

replaceByProperty()

Replaces an index element by a property element.

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

The offset at which to replace

$name : string = null

The new name of the element. Optional

Tags
throws
OutOfBoundsException

If the offset is invalid

Return values
mixed

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
Return values
mixed

Search results