Identity Map object.
Helps prevent duplication of objects within the system, preventing bugs with overwriting changes etc. All watched objects should return a unique string (usually it will actually be an integer, but strings are supported). via a getID() method.
| package | dstruct_common |
|---|
add(object $obj)
object
exists(string $classname, string $id) : mixed
This takes class name and id as the check should be made before the new object would have been instanced!
string
string
mixedThe object, if it is found, or false.getCacheHits() : integer
integergetObjectCount() : integer
| todo | changed - needs checking |
|---|
integerinstance() : object
objectremove(object $obj) : boolean
object
booleanTrue on success, false if object not found.__construct()
globalKey(object $obj) : string
Watched objects are identified by their class and their ID
object
string$cachehits : integer
$instance : object
$objs : array