Deletes this object from the database
968810
protected function deleteInternal()
    {
        if ($this->table === null || $this->id_field === null) {
            return;
        }

        $id_field = new SwatDBField($this->id_field, 'integer');

        if (!property_exists($this, $id_field->name)) {
            return;
        }

        $id_ref = $id_field->name;
        $id = $this->$id_ref;

        if ($id !== null) {
            $ns_array = $this->getCacheNamespaces();

            SwatDB::deleteRow(
                $this->db,
                $this->table,
                $id_field->__toString(),
                $id
            );

            $this->flushCacheNamespaces($ns_array);
        }
    }
123847
def delete(self, primary_key):
        
        ''' 
            
        '''
        
        title = '%s.delete' % self.__class__.__name__
    
    # delete object
        delete_statement = self.table.delete(self.table.c.id==primary_key)
        self.session.execute(delete_statement)
    
    # return message
        exit_msg = '%s has been deleted.' % primary_key
        return exit_msg
268936
def delete(self, instance):
        ''''''
        flushdb(self.client) if flushdb else self.client.flushdb()
137346
public function delete()
    {
        $data = $this->getData();
        if (isset($this->currentId))
            unset($data[$this->currentKey]);
        elseif($this->documentEntries)
            $data = array_diff_key($data,$this->documentEntries);
        else
            $data = [];
        $this->documentEntries = array_values($data);
        return $this->databaseDocument->put($this->documentEntries) ? true : false;
    }
834744
def delete(self):
        
        if self._on_delete is not None:
            return self._on_delete(self)

        return self._query.delete()
414463
public function delete()
    {
        $app = Facade::getFacadeApplication();
        $db = $app->make('database')->connection();

        $cvID = $this->cvID;
        $c = Page::getByID($this->cID, $cvID);
        $cID = $c->getCollectionID();

        $q = "select bID, arHandle from CollectionVersionBlocks where cID = ? and cvID = ?";
        $r = $db->executeQuery($q, array(
            $cID,
            $cvID,
        ));
        while ($row = $r->fetch()) {
            if ($row['bID']) {
                $b = Block::getByID($row['bID'], $c, $row['arHandle']);
                if (is_object($b)) {
                    $b->deleteBlock();
                }
                unset($b);
            }
        }

        $features = CollectionVersionFeatureAssignment::getList($this);
        foreach ($features as $fa) {
            $fa->delete();
        }

        $category = $app->make('Concrete\Core\Attribute\Category\PageCategory');
        $attributes = $category->getAttributeValues($this);
        foreach ($attributes as $attribute) {
            $category->deleteValue($attribute);
        }

        $db->executeQuery('delete from CollectionVersionBlockStyles where cID = ? and cvID = ?', array(
            $cID,
            $cvID,
        ));
        $db->executeQuery('delete from CollectionVersionThemeCustomStyles where cID = ? and cvID = ?', array(
            $cID,
            $cvID,
        ));
        $db->executeQuery('delete from CollectionVersionRelatedEdits where cID = ? and cvID = ?', array(
            $cID,
            $cvID,
        ));
        $db->executeQuery('delete from CollectionVersionAreaStyles where cID = ? and cvID = ?', array(
            $cID,
            $cvID,
        ));

        $db->executeQuery('delete from PageTypeComposerOutputBlocks where cID = ? and cvID = ?', array(
            $cID,
            $cvID,
        ));

        $q = "delete from CollectionVersions where cID = '{$cID}' and cvID='{$cvID}'";
        $db->executeQuery($q);
        $this->refreshCache();
    }
1191927
def delete(self, obj):
        """"""
        del_id = obj.get_id()
        if not del_id:
            return

        coll = self.get_collection(obj.__class__.get_table_name())
        coll.delete_one({"_id": del_id})
381544
public function destroy()
    {
        foreach (self::$connectionList as $dbDriver) {
            if (self::$transaction) {
                $dbDriver->commitTransaction();
            }
        }
        self::$transaction = false;
        self::$connectionList = [];
    }
1224663
def delete(self):
        
        del_query = self._clone()

        # The delete is actually 2 queries - one to find related objects,
        # and one to delete. Make sure that the discovery of related
        # objects is performed on the same database as the deletion.
        del_query._clear_ordering()
        connection = self.model._meta.dj_connection

        connection.connection.delete_by_query(indices=connection.database, doc_types=self.model._meta.db_table,
                                              query=del_query._build_query())
        connection.connection.indices.refresh(indices=connection.database)
        # Clear the result cache, in case this QuerySet gets reused.
        self._result_cache = None
679051
def delete(self):
        ''' 
        '''
        SQL = 'DELETE FROM %s' % self._table
        if self._selectors:
            SQL = ' '.join([SQL, 'WHERE', self._selectors]).strip()
        
        return SQL
1114387
public function delete ()
	{
		$this->before_delete();

		$statement = 'DELETE FROM ' . static::$table_name;

		$pk = $this->primary_key_condition();

		$statement .= ' WHERE ' . $pk->statement;

		$result = $this->db->query($statement, $pk->values->getArrayCopy(), 'multi', null, false);

		$this->stored = true;
		$this->updated = false;

		$this->after_delete();

		return true;
	}
706090
public function delete()
    {
        $this->brokenOnDelete = true;
        $this->onBeforeDelete();
        if ($this->brokenOnDelete) {
            user_error(static::class . " has a broken onBeforeDelete() function."
                . " Make sure that you call parent::onBeforeDelete().", E_USER_ERROR);
        }

        // Deleting a record without an ID shouldn't do anything
        if (!$this->ID) {
            throw new LogicException("DataObject::delete() called on a DataObject without an ID");
        }

        // TODO: This is quite ugly.  To improve:
        //  - move the details of the delete code in the DataQuery system
        //  - update the code to just delete the base table, and rely on cascading deletes in the DB to do the rest
        //    obviously, that means getting requireTable() to configure cascading deletes ;-)
        $srcQuery = DataList::create(static::class)
            ->filter('ID', $this->ID)
            ->dataQuery()
            ->query();
        $queriedTables = $srcQuery->queriedTables();
        $this->extend('updateDeleteTables', $queriedTables, $srcQuery);
        foreach ($queriedTables as $table) {
            $delete = SQLDelete::create("\"$table\"", array('"ID"' => $this->ID));
            $this->extend('updateDeleteTable', $delete, $table, $queriedTables, $srcQuery);
            $delete->execute();
        }
        // Remove this item out of any caches
        $this->flushCache();

        $this->onAfterDelete();

        $this->OldID = $this->ID;
        $this->ID = 0;
    }
1289060
def delete(self):
        

        es = connections.get_connection(self._using)

        return AttrDict(
            es.delete_by_query(
                index=self._index,
                body=self.to_dict(),
                **self._params
            )
        )
129194
public function delete()
    {
        $this->defaultTable();
        $this->eq($this->primary, $this->__get($this->primary));

        return DB::delete($this->sql);
    }
811849
public function delete()
    {
        $this->brokenOnDelete = true;
        $this->onBeforeDelete();
        if ($this->brokenOnDelete) {
            user_error("$this->class has a broken onBeforeDelete() function."
            . " Make sure that you call parent::onBeforeDelete().", E_USER_ERROR);
        }

        $path = $this->getFullPath();
        if (file_exists($path)) {
            unlink($path);
        }
        if ($this->storeRecord) {
            $this->storeRecord->delete();
        }

        $this->flushCache();
        $this->onAfterDelete();
    }
677838
def delete(self):
        """"""
        self._client.remove_object(self._instance, self._bucket, self.name)
723139
public function delete() {
        global $DB;

        if (empty($this->id)) {
            debugging('Can not delete data object, no id!');
            return false;
        }

        $data = $this->get_record_data();

        if ($DB->delete_records($this->table, array('id'=>$this->id))) {
            $this->notify_changed(true);
            return true;

        } else {
            return false;
        }
    }