ObjectCollectionTrait uses trait:short
ObjectCollection Trait
Tags
Table of Contents
Properties
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
$type
protected
static string
$type
$_key
private
string
$_key
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
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
$thisdoDefProperty()
public
doDefProperty(string $property, mixed $default) : $this
Parameters
- $property : string
-
Object property to be updated.
- $default : mixed
-
Default value.
Return values
$thisdoGetProperty()
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
$thisdoUnsetProperty()
public
doUnsetProperty(string $property) : $this
Parameters
- $property : string
-
Object property to be updated.
Return values
$thisgetKey()
public
getKey() : string
Return values
stringgetObjectKeys()
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
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
Tags
Return values
array<string|int, mixed>hasKey()
public
hasKey() : bool
Return values
boolhasProperty()
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
stringsetKey()
public
setKey(string $key) : $this
Parameters
- $key : string
Return values
$thissetProperty()
public
setProperty(string $property, mixed $value) : $this
Parameters
- $property : string
-
Object property to be updated.
- $value : mixed
-
New value.
Return values
$thisunserialize()
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
$thisdoSerialize()
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>
getTypePrefix()
protected
getTypePrefix() : string
Return values
stringgetUnserializeAllowedClasses()
protected
getUnserializeAllowedClasses() : array<string|int, mixed>|bool