Login   Register  
PHP Classes
elePHPant
Icontem

File: CacheLib.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Eugene Panin  >  ObjectCache  >  CacheLib.php  >  Download  
File: CacheLib.php
Role: ???
Content type: text/plain
Description: Library file
Class: ObjectCache
Author: By
Last change:
Date: 2001-10-02 06:28
Size: 660 bytes
 

Contents

Class file image Download
<?
class ObjectCache {
	var $cache=array();
	
	function add($anOID,&$obj) {
		$this->cache[$anOID] =& $obj;
	}
	
	function remove($anOID) {
		unset($this->cache[$anOID]);
	}
	
	function &find($anOID) {
		if ($this->cache[$anOID]) return $this->cache[$anOID];
		return null;
	}

	function isExist($anOID) {
		if ($this->cache[$anOID]) return true;
		return false;
	}
	
	function isEmpty() {
		if (count($this->cache)>0) return true;
		return false;
	}
	
	function getKeys() {
		return array_keys($this->cache);
	}
	
	function len() {
		return count($this->cache);
	}
	
	function clear() {
		$this->cache = array();
	}
}
?>