|
Tv2 documentation | |||||
PREV NEXT | FRAMES NO FRAME | |||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
General purpose runtime cache for variables and objects
Field Summary | |
private integer | $counter Counter. |
private array | $data Stored data array |
private array | $keys Key array |
private integer | $size Cache size |
private array | $types Array containing types of vars/objects stored in cache |
Constructor Summary | |
void | ctlRtVarCache([integer $limit]) Constructor. |
Method Summary | |
boolean | add(string $type, mixed $keys, [string $ObjectMethod], [array $ObjectMethodParams]) Adds var to cache |
boolean | addKey(string $type, array $keys) Adds another key alias for a var |
private mixed | callObjectMethod(mixed $id, string $ObjectMethod, [array $ObjectMethodParams]) This method calls a method on object in cache with given $id. |
void | debugOut() This function prints info about cache contents grouped by types. |
boolean | delete(string $type, mixed $keys, [string $ObjectMethod], [array $ObjectMethodParams]) Deletes entity from cache. |
boolean | deleteKeys(string $type, mixed $keys, [boolean $many], [string $ObjectMethod], [array $ObjectMethodParams]) Removes keys that correspond to the var. |
private boolean | error(string $msg) Sends an error to the errors object and returns FALSE |
mixed | exists(string $type, mixed $keys) Checks if var exists in cache |
mixed& | find(string $type, mixed $keys) Searches for var and returns a reference to it |
private mixed | findId(string $type, mixed $keys) Returns internal variable id |
private mixed | findTypeId(string $type) Returns internal type id |
Field Detail |
private integer $counter
Counter. Needed for indexing vars
private array $data
Stored data array
private array $keys
Key array
private integer $size
Cache size
private array $types
Array containing types of vars/objects stored in cache
Constructor Detail |
void ctlRtVarCache([integer $limit])
Constructor. Initializes attributes
limit
- cache size (default 100)Method Detail |
boolean add(string $type, mixed $keys, [string $ObjectMethod], [array $ObjectMethodParams])
Adds var to cache
type
- type namekeys
- key name, or key name arrayObjectMethod
- method name to call on objectObjectMethodParams
- parameters for the methodboolean addKey(string $type, array $keys)
Adds another key alias for a var
type
- type namekeys
- array of keys (should contain at least one previously used key).private mixed callObjectMethod(mixed $id, string $ObjectMethod, [array $ObjectMethodParams])
This method calls a method on object in cache with given $id. Used in $this->delete() and $this->deleteKeys() methods.
id
- id of object in cacheObjectMethod
- Object method nameObjectMethodParams
- Array of parameters to be passed to the method.void debugOut()
This function prints info about cache contents grouped by types. Usefull for debugging purposes.
boolean delete(string $type, mixed $keys, [string $ObjectMethod], [array $ObjectMethodParams])
Deletes entity from cache. Can optionally call a method on objects.
type
- type namekeys
- key name or key name arrayObjectMethod
- method name to call on objectObjectMethodParams
- parameters for the methodboolean deleteKeys(string $type, mixed $keys, [boolean $many], [string $ObjectMethod], [array $ObjectMethodParams])
Removes keys that correspond to the var.
type
- type namekeys
- key name or array of key namesmany
- If $many == TRUE it means that $keys may belong to different entities (makes operate slower). Default is FALSE.ObjectMethod
- method name to call on objectObjectMethodParams
- parameters for the methodprivate boolean error(string $msg)
Sends an error to the errors object and returns FALSE
msg
- error messagemixed exists(string $type, mixed $keys)
Checks if var exists in cache
type
- type namekeys
- key name or key name arraymixed& find(string $type, mixed $keys)
Searches for var and returns a reference to it
type
- type namekeys
- key name or array of key namesprivate mixed findId(string $type, mixed $keys)
Returns internal variable id
type
- type namekeys
- key name or key name arrayprivate mixed findTypeId(string $type)
Returns internal type id
type
- type name
|
Tv2 documentation | |||||
PREV NEXT | FRAMES NO FRAME | |||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This document was generated by phpdocgen 0.17-rc3.
Copyright © 2002-03 Stéphane GALLAND (under the GNU General Public License)