Documentation

NestedPropertyTrait

Nested Property Object Trait

Table of Contents

Methods

defNestedProperty()  : $this
getNestedProperty()  : mixed
hasNestedProperty()  : bool
setNestedProperty()  : $this
unsetNestedProperty()  : $this

Methods

defNestedProperty()

public defNestedProperty(string $property, mixed $default[, string|null $separator = null ]) : $this
Parameters
$property : string

Object property to be updated.

$default : mixed

Default value.

$separator : string|null = null

Separator, defaults to '.'

Tags
throws
RuntimeException
Return values
$this

getNestedProperty()

public getNestedProperty(string $property[, mixed|null $default = null ][, string|null $separator = null ]) : mixed
Parameters
$property : string

Object property to be fetched.

$default : mixed|null = null

Default value if property has not been set.

$separator : string|null = null

Separator, defaults to '.'

Return values
mixed

Property value.

hasNestedProperty()

public hasNestedProperty(string $property[, string|null $separator = null ]) : bool
Parameters
$property : string

Object property name.

$separator : string|null = null

Separator, defaults to '.'

Return values
bool

True if property has been defined (can be null).

setNestedProperty()

public setNestedProperty(string $property, mixed $value[, string|null $separator = null ]) : $this
Parameters
$property : string

Object property to be updated.

$value : mixed

New value.

$separator : string|null = null

Separator, defaults to '.'

Tags
throws
RuntimeException
Return values
$this

unsetNestedProperty()

public unsetNestedProperty(string $property[, string|null $separator = null ]) : $this
Parameters
$property : string

Object property to be updated.

$separator : string|null = null

Separator, defaults to '.'

Tags
throws
RuntimeException
Return values
$this

        
On this page

Search results