Beispiel #1
0
 /**
  * Basic update. It returns false if the keys from $values or $where doesn't
  * match with the fields defined in the construct
  * 
  * @access public
  * @since unknown
  * @param array $values Array with keys (database field) and values
  * @param array $where
  * @return mixed It returns the number of affected rows if the update has been 
  * correct or false if an error happended
  */
 function update($values, $where)
 {
     if (!$this->checkFieldKeys(array_keys($values))) {
         return false;
     }
     if (!$this->checkFieldKeys(array_keys($where))) {
         return false;
     }
     $this->dao->from($this->getTableName());
     $this->dao->set($values);
     $this->dao->where($where);
     return $this->dao->update();
 }