private function createReaction($id) { $key = "ReactionObject-{$id}"; if ($this->cacheMgr->isCached($key)) { return $this->cacheMgr->load($key); } else { $object = new Reaction($id); $this->cacheMgr->save($key, $object, 3600); return $object; } }
/** * Returns all columns of all rows from the systems table as an associative array keyed by systemID. * @param none * @return array */ public function getAllSystems() { $key = __METHOD__ . "(" . implode(",", func_get_args()) . ")"; if ($this->cacheMgr->isCached($key)) { $systems = $this->cacheMgr->load($key); } else { $sql = "SELECT systemID, systemName FROM {$this->dbPrefix}systems ORDER BY systemID ASC;"; $query = $this->pdo->prepare($sql); $query->execute(); if ($systems = $query->fetchAll(PDO::FETCH_KEY_PAIR)) { if (count($systems) > 0) { $this->cacheMgr->save($key, $systems, 86400); } } $query->closeCursor(); $query = null; } return $systems; }