cache)) { return $this->cache[$key]; } return null; } public function set($key, $value) { $this->cache[$key] = $value; return true; } public function getCache() { return $this->cache; } public function delete($key) { unset($this->cache[$key]); return true; } public function purge($beginning = "", $casesensitive = true) { if(!$beginning) { $this->cache = []; return true; } foreach($this->cache as $key => $value) { if(!$casesensitive) { if(strpos(strtolower($key), strtolower($beginning)) === 0) { unset($this->cache[$key]); } } if(strpos($key, $beginning) === 0) { unset($this->cache[$key]); } } return true; } public function getMfObject($objectname, $id) { $object = $this->get("mfObjectmodel-$objectname-".$id); if(!$object) { $object = new $objectname($id); $a = new ADBNetzgebiet(1); if((method_exists($object, "isLoaded") && !$object->isLoaded()) || !$object->id) { $this->set("mfObjectmodel-$objectname-".$id, $object); } } return $object; } }