Reducer
in package
Table of Contents
Properties
- $bag : Collection
- $disabled : bool
- $enableDebug : bool
- $entityObjs : Collection
- $existingEntities : array<string, bool>
- $existingKeys : array<string|int, mixed>
- Prevent duplicate keys.
- $logger : LoggerInterface
- $parameters : array<string|int, mixed>
- $reducers : array<string|int, mixed>
- $store : Store
- $traitMap : array<string, bool>
Methods
- __construct() : mixed
- addEntity() : void
- capture() : void
- collect() : Collection
- disable() : mixed
- enable() : mixed
- entities() : Collection
- entityKey() : mixed
- flush() : void
- get() : mixed
- getEntity() : mixed
- hasEntity() : mixed
- lists() : Collection
- loadMissingEntities() : void
- put() : void
- putMany() : void
- register() : void
- remember() : mixed
- setLogger() : mixed
- types() : array<string|int, mixed>
- values() : Collection
- with() : void
- add() : void
- findMissingEntity() : void
- hasTrait() : bool
- loadMissing() : void
Properties
$bag
private
Collection
$bag
$disabled
private
bool
$disabled
$enableDebug
private
bool
$enableDebug
$entityObjs
private
Collection
$entityObjs
$existingEntities
private
array<string, bool>
$existingEntities
= []
$existingKeys
Prevent duplicate keys.
private
array<string|int, mixed>
$existingKeys
= []
$logger
private
LoggerInterface
$logger
$parameters
private
array<string|int, mixed>
$parameters
$reducers
private
array<string|int, mixed>
$reducers
= []
$store
private
Store
$store
$traitMap
private
array<string, bool>
$traitMap
= []
Methods
__construct()
public
__construct() : mixed
addEntity()
public
addEntity(Entity $entity[, bool $overwrite = false ]) : void
Parameters
- $entity : Entity
- $overwrite : bool = false
capture()
public
capture(mixed $data) : void
Parameters
- $data : mixed
Tags
collect()
public
collect(string $ns[, string $type = '*' ]) : Collection
Parameters
- $ns : string
- $type : string = '*'
Return values
Collectiondisable()
public
disable() : mixed
enable()
public
enable() : mixed
entities()
public
entities() : Collection
Return values
CollectionentityKey()
public
entityKey(mixed $type, mixed $id) : mixed
Parameters
- $type : mixed
- $id : mixed
flush()
public
flush() : void
get()
public
get(string $name[, mixed|null $callback = null ]) : mixed
Parameters
- $name : string
- $callback : mixed|null = null
getEntity()
public
getEntity( $type, $id[, $callback = null ]) : mixed
Parameters
hasEntity()
public
hasEntity(mixed $type, mixed $id) : mixed
Parameters
- $type : mixed
- $id : mixed
lists()
public
lists(string $ns[, string $type = '*' ]) : Collection
Parameters
- $ns : string
- $type : string = '*'
Return values
CollectionloadMissingEntities()
public
loadMissingEntities(mixed $type, Collection $ids) : void
Parameters
- $type : mixed
- $ids : Collection
put()
public
put(string $cacheId, mixed $value) : void
Parameters
- $cacheId : string
- $value : mixed
putMany()
public
putMany(array<string|int, mixed> $values) : void
Parameters
- $values : array<string|int, mixed>
register()
public
register(array<string|int, mixed> $reducers) : void
Parameters
- $reducers : array<string|int, mixed>
remember()
public
remember(string $name, mixed $callback) : mixed
Parameters
- $name : string
- $callback : mixed
setLogger()
public
setLogger(LoggerInterface $logger) : mixed
Parameters
- $logger : LoggerInterface
types()
public
types(string $ns[, string $type = '*' ]) : array<string|int, mixed>
Parameters
- $ns : string
- $type : string = '*'
Return values
array<string|int, mixed>values()
public
values(string $ns[, string $type = '*' ]) : Collection
Parameters
- $ns : string
- $type : string = '*'
Return values
Collectionwith()
public
with(array<string|int, mixed> $parameters) : void
Parameters
- $parameters : array<string|int, mixed>
add()
private
add(string $ns, string $type, mixed $value) : void
Parameters
- $ns : string
- $type : string
- $value : mixed
findMissingEntity()
private
findMissingEntity(string $type, string $id) : void
Parameters
- $type : string
- $id : string
hasTrait()
private
hasTrait(mixed $className, mixed $traitName) : bool
Parameters
- $className : mixed
- $traitName : mixed
Return values
boolloadMissing()
private
loadMissing() : void