Documentation

Core_ObjectWatcher
in package

Implement an Identity Map pattern

Tags
subpackage

Core

version
7.x
author

Hostmake LLC

copyright

© 2005-2024 ООО "Хостмэйк" (Hostmake LLC), http://www.hostcms.ru

Table of Contents

Properties

$config  : mixed
ObjectWatcher config
$_maxObjects  : array<string|int, mixed>
Maximum count of objects Максимальное количество объектов
$_cache  : array<string|int, mixed>
Cache
$_instance  : mixed
The singleton instance.

Methods

add()  : mixed
Add instance of $model to cahce
clear()  : mixed
Clear all instances
delete()  : mixed
Delete instance of $model from cahce
exists()  : mixed
Checks if instance of $classname already exist
getKey()  : string
Get primary key of model
instance()  : object
Register an existing instance as a singleton.
reduce()  : mixed
Reduce cache
__construct()  : mixed
Constructor.

Properties

$config

ObjectWatcher config

public static mixed $config = \NULL

$_maxObjects

Maximum count of objects Максимальное количество объектов

protected static array<string|int, mixed> $_maxObjects = \NULL

$_cache

Cache

private array<string|int, mixed> $_cache = array()

$_instance

The singleton instance.

private static mixed $_instance

Methods

exists()

Checks if instance of $classname already exist

public static exists(string $classname, string $primaryKey) : mixed
Parameters
$classname : string

class name

$primaryKey : string

primary key

instance()

Register an existing instance as a singleton.

public static instance() : object
Return values
object

        
On this page

Search results