com\setasign\Konquadrat\Object

InstancePoolInterface Interface InstancePoolInterface

File: /Konquadrat/src/Object/InstancePoolInterface.php

Implemented in

Summary

Methods

getInstances()

abstract public InstancePoolInterface::getInstances (
void
): array

Get all cached abstractObject instances.

getObjectById()

Get the cached instance of an abstractObject.

Parameters
$id : int
 
Exceptions

Throws UnknownObjectException If the object isn't in the cache.

hasInstance()

abstract public InstancePoolInterface::hasInstance (
int $id
): bool

Checks whether an instance of the abstractObject is in the cache and whether the cache is active.

Parameters
$id : int
 

isActive()

abstract public InstancePoolInterface::isActive (
void
): bool

Returns whether the instance pool is active.

reset()

abstract public InstancePoolInterface::reset (
void
): self

Reset the instance pool to default settings.

Reset cached instances and activates the instance pool (if inactive).

resetObject()

abstract public InstancePoolInterface::resetObject (
int $id
): self

Reset a single cached instance.

It will not be checked whether this instance exists.

Parameters
$id : int
 

setActive()

abstract public InstancePoolInterface::setActive (
bool $flag = true
): self

Set the flag whether the instance pool caches the abstractObject.

Parameters
$flag : bool
 

setObject()

abstract public InstancePoolInterface::setObject (): void

Enforces an instance for an object id if the pool is active and the object has an id.

Parameters
$object : AbstractObjectInterface