sid, 'type' => type, 'query' => query, 'db' => db). */ public function set($values) { $this->setSID($values['SID']); $this->setType($values['type']); $this->setQuery($values['query']); $this->setDb($values['db']); } /** * loads the object's attributes. * loads the object's attributes by giving a SID as parameter * @param $id the id of the querycaches row */ public function load_With_SID( $id) { $dbl = new DBLayer("lib"); $statement = $dbl->select("ams_querycache", array('id' => $id), "SID=:id"); $row = $statement->fetch(); $this->set($row); } /** * updates the entry. */ public function update(){ $dbl = new DBLayer("lib"); $dbl->update("ams_querycache", Array('type' => $this->getType(), 'query' => $this->getQuery(), 'db' => $this->getDb(), "SID=$this->getSID()" ); } ////////////////////////////////////////////Getters//////////////////////////////////////////////////// /** * get SID attribute of the object. */ public function getSID(){ return $this->SID; } /** * get type attribute of the object. */ public function getType(){ return $this->type; } /** * get query attribute of the object. */ public function getQuery(){ return $this->query; } /** * get db attribute of the object. */ public function getDb(){ return $this->db; } ////////////////////////////////////////////Setters//////////////////////////////////////////////////// /** * set SID attribute of the object. * @param $s integer id */ public function setSID($s){ $this->SID = $s; } /** * set type attribute of the object. * @param $t type of the query, could be changePassword, changePermissions, changeEmail, createUser */ public function setType($t){ $this->type = $t; } /** * set query attribute of the object. * @param $q query string */ public function setQuery($q){ $this->query= $q; } /** * set db attribute of the object. * @param $d the name of the database in the config global var that we want to use. */ public function setDb($d){ $this->db= $d; } }