Delete record from the database.
Requires a uniqueness constraint. Assign
those columns before calling delete().
@return boolean
4746
public function delete()
    {
        if (empty($this->unique)) {
            return false;
        }
        foreach($this->unique as $column) {
            if (!isset($this->instance[$column])) {
                return false;
            }
        }

        $sql = 'DELETE FROM '.$this->fq_name.' WHERE 1=1';
        $args = array();
        foreach($this->unique as $name) {
            $sql .= ' AND '.$this->connection->identifierEscape($name).' = ?';
            $args[] = $this->instance[$name];
        }

        $prep = $this->connection->prepare($sql);
        $result = $this->connection->execute($prep, $args);

        return ($result === false) ? false : true;
    }
487843
public function delete()
    {
        if (!$this->ID) {
            return false;
        }

        try {
            global $wpdb;
            $sql = 'DELETE FROM ' . static::getTableName() . ' WHERE ' . static::$PK . ' = %d';

            return $wpdb->query($wpdb->prepare($sql, $this->ID));
        } catch (Exception $e) {
            return false;
        }
    }
398841
public function deleteRow()
    {
        $this->getLogger()->info('Deleting row ID ' . $this->rowId . ' From dataSet ID ' . $this->dataSetId);
        $this->doDelete('/dataset/data/' . $this->dataSetId . $this->rowId);
        
        return true;
    }
362075
public function delete()
    {
        // Define wheres
        $where = $this->getWhereString();

        // Define where in
        $whereIn = $this->getWhereInString();

        // Build query
        $this->query = 'DELETE FROM ' . $this->table . ' '. $where . ' ' . $whereIn;

        // Prepare statement
        $this->statement = $this->pdo->prepare($this->query);

        // Bind where values
        if (count($this->wheres)) {
            $this->bindWheres();
        }

        // Execute statement
        $result = $this->statement->execute();

        // Reset values
        $this->reset();

        // Return result
        return $result;
    }
549575
public function deleteOutdated(): bool
    {
        $sql =  'DELETE FROM `' . $this->table . '`'
                . ' WHERE `' . $this->savetimeField . '`<'
                . '(' . time() . '-`' . $this->timestampField . '`)';
        return $this->db->query($sql);
    }
1226392
public function delete()
    {
        if ($this->id == 0 || $this->id == ADMIN_ID) return FALSE;
		$conn = self::getDbConnection();
		$str = 'DELETE [LOGIN='.$this->login.'][ID='.$this->id.']';
        $conn->executeQuery('DELETE FROM users_groups_membership WHERE user_id='.$this->id);
        $conn->executeQuery('DELETE FROM users_auth WHERE user_id='.$this->id);
        parent::delete();
			
	    Event::trigger(EVENT_CORE_USER_PROP,['message' => $str]);
    }
1033846
public function delete()
    {
        Manager::getInstance()->get($this)->refreshRelations();
        $pmk = $this->getPrimaryKey();
        $sql = Sql::createSql($this->getAdapter())
            ->delete($this->getTableName())
            ->where(["{$pmk} = :id" => [':id' => $this->$pmk]]);
        $event = new Delete([
            'primaryKey' => $this->$pmk,
            'abort' => false
        ]);
        $this->getEventManager()->trigger(Delete::BEFORE_DELETE, $this, $event);

        if ($event->abort) {
            return false;
        }
        $result = $sql->execute();
        $this->getEventManager()->trigger(Delete::AFTER_DELETE, $event);
        return $result > 0;
    }
453659
public function deleteColumn()
    {
        $this->getLogger()->info('Deleting column ID ' . $this->dataSetColumnId . ' From dataSet ID ' . $this->dataSetId);
        $this->doDelete('/dataset/' . $this->dataSetId . '/column/' . $this->dataSetColumnId);
        
        return true;
    }
778885
public function deleteLocalisedRecords()
    {
        if ($this->hasExtension(self::FLUENT_CLASS))
        {
            $localisedTables = $this->getLocalisedTables();
            $tableClasses = ClassInfo::ancestry($this->owner, true);

            foreach ($tableClasses as $class)
            {
                $table = DataObject::getSchema()->tableName($class);

                $rootTable = $this->getLocalisedTable($table);
                $rootDelete = SQLDelete::create("\"{$rootTable}\"")
                    ->addWhere(["\"{$rootTable}\".\"ID\"" => $this->ID]);

                // If table isn't localised, simple delete
                if (!isset($localisedTables[$table]))
                {
                    $baseTable = $this->getLocalisedTable($this->baseTable());

                    // The base table isn't localised? Delete the record then.
                    if ($baseTable === $rootTable)
                    {
                        $rootDelete->execute();
                        continue;
                    }

                    $rootDelete
                        ->setDelete("\"{$rootTable}\"")
                        ->addLeftJoin(
                            $baseTable,
                            "\"{$rootTable}\".\"ID\" = \"{$baseTable}\".\"ID\""
                        )
                        // Only when join matches no localisations is it safe to delete
                        ->addWhere("\"{$baseTable}\".\"ID\" IS NULL")
                        ->execute();

                    continue;
                }

                $localisedTable = $this->getLocalisedTable($table);
                $localisedDelete = SQLDelete::create(
                    "\"{$localisedTable}\"",
                    [
                        '"RecordID"' => $this->ID,
                    ]
                );
                $localisedDelete->execute();
            }
        }

        return $this;
    }
46082
private function doDelete() {
        $db     = $this->db();
        $entity = $this->dao()->getEntityMapping();
        $table  = $entity->getTableName();

        // collect identity infos
        $identity = $entity->getIdentity();
        $idColumn = $identity->getColumn();
        $idValue  = $identity->convertToDBValue($this->getObjectId(), $db);

        // create SQL
        $sql = 'delete from '.$table.'
                   where '.$idColumn.' = '.$idValue;

        // execute SQL and check for concurrent modifications
        if ($db->execute($sql)->lastAffectedRows() != 1)
            throw new ConcurrentModificationException('Error deleting '.get_class($this).' (oid='.$this->getObjectId().'): record not found');
        return true;
    }
587304
public function delete()
	{
		// temporary disable relations
		$tmp_relations   = $this->relations;
		$this->relations = array();

		// Build query and execute update
		$query = \DB::delete(call_user_func($this->model.'::table'));
		$tmp   = $this->build_query($query, array(), 'delete');
		$query = $tmp['query'];
		$res = $query->execute($this->write_connection);

		// put back any relations settings
		$this->relations = $tmp_relations;

		return $res > 0;
	}
1372122
public function delete()
    {
        self::$instance->reset();
        $this->sql('DELETE');
        $this->oosql_where = null;
        $numargs = func_num_args();

        if ($numargs > 0) {
            if ($numargs > 1) {
                $this->oosql_del_multiFlag = true;
                $this->oosql_del_numargs = $numargs;
            }
            $arg_list = func_get_args();
            if (is_array($arg_list[0])) {
                $this->sql(' FROM ' . $this->oosql_table);
                $this->where($arg_list[0][0] . ' = ?', $arg_list[0][1]);
                return $this;
            }
            $this->oosql_sql .= ' FROM';
            for ($i = 0; $i < $numargs; $i++) {
                if ($i != 0 && $numargs > 1) {
                    $this->sql(',');
                }
                $this->sql(' ' . $arg_list[$i]);
            }

        } else {
            $this->oosql_fromFlag = true;
        }


        return $this;
    }
281422
public function delete() : int
    {
        $sql = "DELETE FROM `".$this->tableName."` "
            . "WHERE `".$this->primaryKey."` = '".$this->id."';";
        return $this->db->exec($sql);
    }
654388
public function delete()
    {
        $result = false;
        
        if ($this->beforeDelete()) {
            $this->updateAttributes(static::internalUpdateValues());
            $result = true;
            $this->afterDelete();
        }
        
        return $result;
    }
24434
public function delete()
    {
        // Validate form
        $form = $this->getForm('Delete' . $this->getEntityName());
        if (!$form->isValid()) {
            $this->addMessage($form->getMessages(), FlashMessenger::NAMESPACE_ERROR);
            return false;
        }

        // Remove account entity
        $entity = $form->getData();
        $this->getEntityManager()->remove($entity);

        // Trigger ondelete
        $this->onDelete($entity);

        // Save
        return $this->save($this->getEntityName() . ' deleted.', 'Unable to delete ' . strtolower($this->getEntityName()) . '.');
    }
965282
public function delete()
    {
        $query = "DELETE FROM `{$this->table}` {$this->join}";
        if ($this->condition) {
            $query .= " WHERE {$this->condition}";
        }
        if ($this->limit) {
            $query .= " LIMIT {$this->limit}";
        }

        return $this->connection->execQuery($query, $this->params);
    }
203162
public function clear()
    {
        try {
            $this->db->from($this->table)->delete();
        } catch (PDOException $e) {
            return false;
        }

        return true;
    }