NestedObjectCollectionInterface
extends
ObjectCollectionInterface
in
Common Interface for both Objects and Collections
Tags
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
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
Return values
array<string|int, static>copy()
Create a copy from this collection by cloning all objects in the collection.
public
copy() : static
Tags
Return values
staticdefNestedProperty()
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
Return values
$thisdefProperty()
public
defProperty(string $property, mixed $default) : $this
Parameters
- $property : string
-
Object property to be defined.
- $default : mixed
-
Default value.
Return values
$thisgetKey()
public
getKey() : string
Return values
stringgetNestedProperty()
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.
getObjectKeys()
public
getObjectKeys() : array<string|int, mixed>
Return values
array<string|int, mixed>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.
getType()
public
getType() : string
Return values
stringgroup()
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.
limit()
public
limit(int $start[, int|null $limit = null ]) : ObjectCollectionInterface
Parameters
- $start : int
- $limit : int|null = null
Tags
Return values
ObjectCollectionInterfaceorderBy()
public
orderBy(array<string|int, mixed> $ordering) : ObjectCollectionInterface
Parameters
- $ordering : array<string|int, mixed>
Tags
Return values
ObjectCollectionInterfacereverse()
Reverse the order of the items.
public
reverse() : CollectionInterface
Tags
Return values
CollectionInterfaceselect()
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
Return values
CollectionInterfacesetKey()
public
setKey(string $key) : $this
Parameters
- $key : string
Return values
$thissetNestedProperty()
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
Return values
$thissetProperty()
public
setProperty(string $property, mixed $value) : $this
Parameters
- $property : string
-
Object property to be updated.
- $value : mixed
-
New value.
Return values
$thisshuffle()
Shuffle items.
public
shuffle() : CollectionInterface
Tags
Return values
CollectionInterfaceunselect()
Un-select items from collection.
public
unselect(array<string|int, int|string> $keys) : CollectionInterface
Parameters
- $keys : array<string|int, int|string>
Tags
Return values
CollectionInterfaceunsetNestedProperty()
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
Return values
$thisunsetProperty()
public
unsetProperty(string $property) : $this
Parameters
- $property : string
-
Object property to be unset.