Documentation

NestedObjectCollectionInterface extends ObjectCollectionInterface

Common Interface for both Objects and Collections

Tags
template
template
extends

Table of Contents

Methods

call()  : array<string|int, mixed>
chunk()  : array<string|int, mixed>
Split collection into chunks.
collectionGroup()  : array<string|int, static>
Group items in the collection by a field and return them as associated array of collections.
copy()  : static
Create a copy from this collection by cloning all objects in the collection.
defNestedProperty()  : $this
defProperty()  : $this
getKey()  : string
getNestedProperty()  : array<string|int, mixed>
getObjectKeys()  : array<string|int, mixed>
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.
hasNestedProperty()  : array<string|int, bool>
hasProperty()  : array<string|int, bool>
limit()  : ObjectCollectionInterface
orderBy()  : ObjectCollectionInterface
reverse()  : CollectionInterface
Reverse the order of the items.
select()  : CollectionInterface
Select items from collection.
setKey()  : $this
setNestedProperty()  : $this
setProperty()  : $this
shuffle()  : CollectionInterface
Shuffle items.
unselect()  : CollectionInterface
Un-select items from collection.
unsetNestedProperty()  : $this
unsetProperty()  : $this

Methods

call()

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

Method name.

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

List of arguments passed to the function.

Return values
array<string|int, mixed>

Return values.

chunk()

Split collection into chunks.

public chunk(int $size) : array<string|int, mixed>
Parameters
$size : int

Size of each chunk.

Tags
phpstan-return

array<array<TKey,T>>

Return values
array<string|int, mixed>

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() : static
Tags
phpstan-return

static<TKey,T>

Return values
static

defNestedProperty()

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

Object property to be defined.

$default : mixed

Default value.

$separator : string|null = null

Separator, defaults to '.'

Tags
throws
RuntimeException
Return values
$this

defProperty()

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

Object property to be defined.

$default : mixed

Default value.

Return values
$this

getNestedProperty()

public getNestedProperty(string $property[, mixed|null $default = null ][, string|null $separator = null ]) : array<string|int, 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
array<string|int, mixed>

List of [key => value] pairs.

getProperty()

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

Object property to be fetched.

$default : mixed|null = null

Default value if property has not been set.

Return values
array<string|int, mixed>

List of [key => value] pairs.

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
Return values
array<string|int, mixed>

hasNestedProperty()

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

Object property name.

$separator : string|null = null

Separator, defaults to '.'

Return values
array<string|int, bool>

List of [key => bool] pairs.

hasProperty()

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

Object property name.

Return values
array<string|int, bool>

List of [key => bool] pairs.

select()

Select items from collection.

public select(array<string|int, int|string> $keys) : CollectionInterface

Collection is returned in the order of $keys given to the function.

Parameters
$keys : array<string|int, int|string>
Tags
phpstan-return

static<TKey,T>

Return values
CollectionInterface

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

setProperty()

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

Object property to be updated.

$value : mixed

New value.

Return values
$this

unsetNestedProperty()

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

Object property to be unset.

$separator : string|null = null

Separator, defaults to '.'

Tags
throws
RuntimeException
Return values
$this

unsetProperty()

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

Object property to be unset.

Return values
$this

        
On this page

Search results