Run the default delete function on the builder.

@return mixed
172828
public function forceDelete()
    {
        // get records
        $affectedRecords = $this->getAffectedRecords()->toArray();
        $ids = array_map(function($record) {
            return $record->{$this->model->getKeyName()};
        }, $affectedRecords);

        // delete main table records
        if (! $this->query->delete()) {
            return false;
        }

        // delete version table records
        $db = $this->model->getConnection();
        return $db->table($this->model->getVersionTable())
            ->whereIn($this->model->getVersionKeyName(), $ids)
            ->delete();
    }
487998
public function run()
    {
        $model = $this->modelFullName;


        if ($model::deleteAll($this->conditions)) {
            Yii::$app->getSession()->setFlash('success', 'You have deleted all selected records!');
            return $this->controller->goBack();
        }

        Yii::$app->getSession()->setFlash('error', 'You have failed to deleted all selected records!');
		return $this->controller->goBack();
    }
649154
public function destroy()
    {
        $table   = $this->_builder->table;
        $where   = $this->_builder->where;

        $builder = new Builder();
        $builder->prefix = "delete";
        $builder->fields = "";
        $builder->table  = $table;
        $builder->where  = $where;

        $cls = $this->_cls;
        return $cls::executePrepared($builder, $this->_vals)->rowCount()>0;
    }
74560
public function getDeletedAt() : ?string 
    {
        if ( ! $this->hasDeletedAt()) {
            $this->setDeletedAt($this->getDefaultDeletedAt());
        }
        return $this->deletedAt;
    }
1158148
public function execute() {
        global $DB;

        // Automatic creation of deletion requests must be enabled.
        if (get_config('tool_dataprivacy', 'automaticdeletionrequests')) {
            // Select all deleted users that do not have any delete data requests created for them.
            $sql = "SELECT DISTINCT(u.id)
                  FROM {user} u
             LEFT JOIN {tool_dataprivacy_request} r
                       ON u.id = r.userid
                 WHERE u.deleted = ?
                       AND (r.id IS NULL
                           OR r.type != ?)";

            $params = [
                1,
                api::DATAREQUEST_TYPE_DELETE
            ];

            $deletedusers = $DB->get_records_sql($sql, $params);
            $createdrequests = 0;

            foreach ($deletedusers as $user) {
                api::create_data_request($user->id, api::DATAREQUEST_TYPE_DELETE,
                    get_string('datarequestcreatedfromscheduledtask', 'tool_dataprivacy'),
                    data_request::DATAREQUEST_CREATION_AUTO);
                $createdrequests++;
            }

            if ($createdrequests > 0) {
                mtrace($createdrequests . ' delete data request(s) created for existing deleted users');
            }
        }
    }
516068
public function delete(){
        return X::app()->db->table(self::tableName())->delete([self::$pk=>$this->{self::$pk}]);
    }
129194
public function delete()
    {
        $this->defaultTable();
        $this->eq($this->primary, $this->__get($this->primary));

        return DB::delete($this->sql);
    }
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;
    }
569072
public function delete()
    {
        if ($this->getPk() === null) {
            return false;
        }
        $query = $this->_queryClass;
        $bindKey = PdoBindHelper::generateBindKey();
        $result = DbConnector::getAdapter()->delete((new $query)->getTableName(), $this->_pkWhere($bindKey), [$bindKey => $this->getInitialStateValue('id')]);
        return ($result > 0) ? true : false;
    }
58503
function clean(): Result {
    return $this->collectionBuilder()
      ->addTask($this->taskCleanDir('var'))
      ->addTask($this->taskDeleteDir(['build', 'doc/api', 'web']))
      ->run();
  }
1230290
public function delete()
    {
        if (isset($this->onDelete)) {
            return call_user_func($this->onDelete, $this);
        }

        return $this->toBase()->delete();
    }
851874
public function delete(): void
    {
        // If this is the default tree, then unset it
        if (Site::getPreference('DEFAULT_GEDCOM') === $this->name) {
            Site::setPreference('DEFAULT_GEDCOM', '');
        }

        $this->deleteGenealogyData(false);

        DB::table('block_setting')
            ->join('block', 'block.block_id', '=', 'block_setting.block_id')
            ->where('gedcom_id', '=', $this->id)
            ->delete();
        DB::table('block')->where('gedcom_id', '=', $this->id)->delete();
        DB::table('user_gedcom_setting')->where('gedcom_id', '=', $this->id)->delete();
        DB::table('gedcom_setting')->where('gedcom_id', '=', $this->id)->delete();
        DB::table('module_privacy')->where('gedcom_id', '=', $this->id)->delete();
        DB::table('hit_counter')->where('gedcom_id', '=', $this->id)->delete();
        DB::table('default_resn')->where('gedcom_id', '=', $this->id)->delete();
        DB::table('gedcom_chunk')->where('gedcom_id', '=', $this->id)->delete();
        DB::table('log')->where('gedcom_id', '=', $this->id)->delete();
        DB::table('gedcom')->where('gedcom_id', '=', $this->id)->delete();

        // After updating the database, we need to fetch a new (sorted) copy
        self::$trees = [];
    }
830124
protected function doDelete()
    {
        $bindings = array_merge($this->bindings['join'], $this->bindings['where']);

        $query = 'DELETE'
            . $this->buildFrom()
            . $this->buildJoin()
            . $this->buildWhere();

        return $this->db->exec($query, $bindings);
    }
620956
public function delete() {
        $query = new DeleteQuery($this->getTable());
        $query->whereConditionGroup($this->getWhereConditionGroup());
        return $this->connection->exec($query);
    }
144486
public function delete(): int
    {
        $this->builder->setDeleteAction();
        $sql = $this->builder->buildSql();
        $this->builder = new QueryBuilder($this->pdo);
        return $this->execSql($sql);
    }
734688
public function delete()
	{
		$db = \App::get('db');

		if (!is_numeric($this->get('uidNumber')))
		{
			$this->setError("missing required field 'uidNumber'");
			return false;
		}

		$classvars = get_class_vars(__CLASS__);

		$affected = 0;

		foreach ($classvars as $property => $value)
		{
			if ('_auxv_' != substr($property, 0, 6) && '_auxs_' != substr($property, 0, 6))
			{
				continue;
			}

			$property = substr($property, 6);

			$query = "DELETE FROM `#__xprofiles_$property` WHERE uidNumber = " . $db->quote($this->get('uidNumber'));
			$db->setQuery($query);

			if (!$db->query())
			{
				$this->setError("Error deleting from xprofiles $property table: " . $db->getErrorMsg());
			}
			else
			{
				$affected += $db->getAffectedRows();
			}
		}

		$query = "DELETE FROM `#__xprofiles` WHERE uidNumber = " . $db->quote($this->get('uidNumber'));
		$db->setQuery($query);

		if (!$db->query())
		{
			$this->setError("Error deleting from xprofiles table: " . $db->getErrorMsg());
		}
		else
		{
			$affected += $db->getAffectedRows();
		}

		if ($affected > 0)
		{
			Event::trigger('user.onAfterDeleteProfile', array($this));
		}

		$this->clear();

		return true;
	}
325461
public function delete()
    {
        DB::beginTransaction();

        try {
            LaravelEvent::fire(static::$name.'.deleting', $this);
            $this->beforeDelete();
            $return = parent::delete();
            $this->afterDelete($return);
            LaravelEvent::fire(static::$name.'.deleted', $this);

            DB::commit();
        } catch (\Exception $e) {
            DB::rollBack();
            throw $e;
        }

        return $return;
    }