Esempio n. 1
0
 /**
  * Delete record
  *
  * @param mixed $key
  * @return boolean
  */
 function delete($key)
 {
     $format = 'DELETE FROM `%s` WHERE `%s`=%s';
     $sql = sprintf($format, $this->_tableName, $this->_keyField, $this->_key4sql($key));
     if ($this->_query($sql)) {
         if ($this->_db->getAffectedRows() > 0) {
             return true;
         } else {
             $this->_error .= ' No record was deleted.';
             return false;
         }
     } else {
         return false;
     }
 }