Documentation

ObjectTrait uses trait:short

Object trait.

Table of Contents

Properties

$type  : string
$_key  : string

Methods

__serialize()  : array<string|int, mixed>
__toString()  : string
Returns a string representation of this object.
__unserialize()  : void
defProperty()  : $this
getKey()  : string
getProperty()  : mixed
getType()  : string
hasKey()  : bool
hasProperty()  : bool
jsonSerialize()  : array<string|int, mixed>
Implements JsonSerializable interface.
serialize()  : string
setProperty()  : $this
unserialize()  : void
unsetProperty()  : $this
doSerialize()  : array<string|int, mixed>
doUnserialize()  : void
getTypePrefix()  : string
getUnserializeAllowedClasses()  : array<string|int, mixed>|bool
setKey()  : $this

Properties

Methods

__serialize()

public final __serialize() : array<string|int, mixed>
Return values
array<string|int, mixed>

__toString()

Returns a string representation of this object.

public __toString() : string
Attributes
#[ReturnTypeWillChange]
Return values
string

__unserialize()

public final __unserialize(array<string|int, mixed> $data) : void
Parameters
$data : array<string|int, mixed>

defProperty()

public defProperty(string $property, mixed $default) : $this
Parameters
$property : string

Object property to be defined.

$default : mixed

Default value.

Return values
$this

getKey()

public getKey() : string
Return values
string

getProperty()

public getProperty(string $property[, mixed $default = null ]) : mixed
Parameters
$property : string

Object property to be fetched.

$default : mixed = null

Default value if property has not been set.

Return values
mixed

Property value.

getType()

public getType([bool $prefix = true ]) : string
Parameters
$prefix : bool = true
Return values
string

hasProperty()

public hasProperty(string $property) : bool
Parameters
$property : string

Object property name.

Return values
bool

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

jsonSerialize()

Implements JsonSerializable interface.

public jsonSerialize() : array<string|int, mixed>
Attributes
#[ReturnTypeWillChange]
Return values
array<string|int, mixed>

serialize()

public final serialize() : string
Return values
string

setProperty()

public setProperty(string $property, mixed $value) : $this
Parameters
$property : string

Object property to be updated.

$value : mixed

New value.

Return values
$this

unserialize()

public final unserialize(string $serialized) : void
Parameters
$serialized : string

unsetProperty()

public unsetProperty(string $property) : $this
Parameters
$property : string

Object property to be unset.

Return values
$this

doSerialize()

protected doSerialize() : array<string|int, mixed>
Return values
array<string|int, mixed>

doUnserialize()

protected doUnserialize(array<string|int, mixed> $serialized) : void
Parameters
$serialized : array<string|int, mixed>

getTypePrefix()

protected getTypePrefix() : string
Return values
string

getUnserializeAllowedClasses()

protected getUnserializeAllowedClasses() : array<string|int, mixed>|bool
Return values
array<string|int, mixed>|bool

setKey()

protected setKey(string $key) : $this
Parameters
$key : string
Return values
$this

        
On this page

Search results