Documentation

ObjectCollectionTrait uses trait:short

ObjectCollection Trait

Tags
template
template

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
call()  : array<string|int, mixed>
collectionGroup()  : array<string|int, static>
Group items in the collection by a field and return them as associated array of collections.
copy()  : T>
Create a copy from this collection by cloning all objects in the collection.
defProperty()  : $this
doDefProperty()  : $this
doGetProperty()  : array<string|int, mixed>
doHasProperty()  : array<string|int, bool>
doSetProperty()  : $this
doUnsetProperty()  : $this
getKey()  : string
getObjectKeys()  : array<string|int, string>
getProperty()  : array<string|int, mixed>
getType()  : string
group()  : array<string|int, mixed>
Group items in the collection by a field and return them as associated array.
hasKey()  : bool
hasProperty()  : array<string|int, bool>
jsonSerialize()  : array<string|int, mixed>
Implements JsonSerializable interface.
serialize()  : string
setKey()  : $this
setProperty()  : $this
unserialize()  : void
unsetProperty()  : $this
doSerialize()  : array<string|int, mixed>
doUnserialize()  : void
getTypePrefix()  : string
getUnserializeAllowedClasses()  : array<string|int, mixed>|bool

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>

call()

public call(string $method[, array<string|int, mixed> $arguments = [] ]) : array<string|int, mixed>
Parameters
$method : string

Method name.

$arguments : array<string|int, mixed> = []

List of arguments passed to the function.

Return values
array<string|int, mixed>

Return values.

collectionGroup()

Group items in the collection by a field and return them as associated array of collections.

public collectionGroup(string $property) : array<string|int, static>
Parameters
$property : string
Tags
phpstan-return

array<static<TKey,T>>

Return values
array<string|int, static>

copy()

Create a copy from this collection by cloning all objects in the collection.

public copy() : T>
Return values
T>

defProperty()

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

Object property to be defined.

$default : mixed

Default value.

Return values
$this

doDefProperty()

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

Object property to be updated.

$default : mixed

Default value.

Return values
$this

doGetProperty()

public & doGetProperty(string $property[, mixed $default = null ][, bool $doCreate = false ]) : array<string|int, mixed>
Parameters
$property : string

Object property to be fetched.

$default : mixed = null

Default value if not set.

$doCreate : bool = false

Not being used.

Return values
array<string|int, mixed>

Key/Value pairs of the properties.

doHasProperty()

public doHasProperty(string $property) : array<string|int, bool>
Parameters
$property : string

Object property to be matched.

Return values
array<string|int, bool>

Key/Value pairs of the properties.

doSetProperty()

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

Object property to be updated.

$value : mixed

New value.

Return values
$this

doUnsetProperty()

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

Object property to be updated.

Return values
$this

getObjectKeys()

public getObjectKeys() : array<string|int, string>
Return values
array<string|int, string>

getProperty()

public getProperty(string $property[, mixed $default = null ]) : array<string|int, mixed>
Parameters
$property : string

Object property to be fetched.

$default : mixed = null

Default value if property has not been set.

Return values
array<string|int, mixed>

Property values.

getType()

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

group()

Group items in the collection by a field and return them as associated array.

public group(string $property) : array<string|int, mixed>
Parameters
$property : string
Tags
phpstan-return

array<TKey,T>

Return values
array<string|int, mixed>

hasProperty()

public hasProperty(string $property) : array<string|int, bool>
Parameters
$property : string

Object property name.

Return values
array<string|int, 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> $data) : void
Parameters
$data : array<string|int, mixed>

getUnserializeAllowedClasses()

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

        
On this page

Search results