public function delete(\Core\Mapped $object) { if ($object->id < 1) { throw new \Core\StorageError("Trying to delete non-existent object."); } $query = new PDOQuery(PDOQuery::Delete, $this->_default_table()); $sth = $this->_backend->prepare($query->sql()); $sth->execute(array(':id' => $object->id)); $object->id = '-1'; return $this; }