You are here

function DB_storage::remove in Flickr API 5

Remove the row represented by this object from the database.

Return value

mixed DB_OK or a DB error

File

phpFlickr/PEAR/DB/storage.php, line 473

Class

DB_storage
Provides an object interface to a table row

Code

function remove() {
  if ($this->_readonly) {
    return $this
      ->raiseError(null, DB_WARNING_READ_ONLY, null, null, null, null, true);
  }
  $query = 'DELETE FROM ' . $this->_table . ' WHERE ' . $this
    ->_makeWhere();
  $res = $this->_dbh
    ->query($query);
  if (DB::isError($res)) {
    return $res;
  }
  foreach ($this->_properties as $prop => $foo) {
    unset($this->{$prop});
  }
  $this->_properties = array();
  $this->_changes = array();
  return DB_OK;
}