Returns the delete query.

@return string the delete query.
169263
private function getDeleteQuery()
	{

		$result = $this->getDeleteClause();

		if ($where = $this->getWhereClause()) {
			$result .= ' ' . $where;
		}

		if ($limit = $this->getLimitClause()) {
			$result .= ' ' . $limit;
		}

		return $result;
	}
901345
public function toDeleteSQL()
    {
        $sql = [];
        $this->params = [];
        
        $sql[] = sprintf('DELETE FROM %s', $this->table->getTableName());
        $sql[] = $this->where->toSQL();
        $this->bind($this->where->getParams());

        return join(' ', $sql);
    }
27702
public function getQuery()
    {

        $strings = $this->string;
        $query = $this->buildQuery($this->getPattern($this->getChieldPattern()), $strings);

        return $query;
    }
411249
public function delete()
    {
        if ($this->request->isPost()) {
            $recordId = StaticFilter::filter(
                'text',
                $this->request->getPost('id')
            );

            $record = call_user_func_array(
                [$this->getModelName(), 'get'],
                [$recordId]
            );

            if (is_null($record)) {
                $this->addWarningMessage(
                    "The {$this->get('modelSingular')} with the provided key ".
                    "does not exists."
                );
            } else {
                if ($record->delete()) {
                    $this->addSuccessMessage(
                        "The {$this->get('modelSingular')} was successfully " .
                        "deleted."
                    );
                }
            }
        }
        return $this->redirect($this->_basePath .'/'.$this->get('modelPlural'));
    }
524334
public function delete(): int
    {
        $deleted = $this->createDeleteBuilder()->execute();

        $this->clearFetchParameters();

        return (int)$deleted;
    }
626273
public function delete()
    {
        $path = $this->model->getPath('destroy');

        return $this->query->from($path)
                ->delete();
    }
1197930
public function delete()
    {
        // Delete row
        $result = static::connection()
            ->delete()
            ->from(static::table())
            ->where(static::$_primaryKey . " = ?", $this->{static::$_primaryKey})
            ->limit(1)
            ->exec();

        // Run filters
        if ($result) {
            $this->runFilters('after', 'delete');
        }

        return $result;
    }
795791
public function delete()
    {
        if ($this->beforeDelete()) {
            if (is_array($this->_pk)) {
                $c = $p = [];
                foreach ($this->_originalPk as $k => $v) {
                    $c[] = "`$k` = :pk_$k";
                    $p[":pk_$k"] = $v;
                }
                $r = (bool)$this->_db->table($this->_tableName)
                    ->where(implode(" AND ", $c), $p)
                    ->delete();
            } else {
                $r = (bool)$this->_db->table($this->_tableName)
                    ->where("`{$this->_pk}` = :__pk")->setParam(':__pk', $this->_originalPk)
                    ->delete();
            }

            if ($r) {
                return $this->afterDelete();
            }
        }
    }
386538
public function getSql()
    {
        if ($this->sql !== null && $this->state === self::STATE_CLEAN) {
            return $this->sql;
        }

        switch ($this->type) {
            case self::DELETE:
                $this->sql = $this->getSqlForDelete();
                break;

            case self::UPDATE:
                $this->sql = $this->getSqlForUpdate();
                break;

            case self::SELECT:
            default:
                $this->sql = $this->getSqlForSelect();
                break;
        }

        $this->state = self::STATE_CLEAN;

        return $this->sql;
    }
131127
public function deleteSql(): string
    {
//        if ($this->filterHasJoin()) {
//            $this->prepareConditions();
//            return $this->createCommand()->delete($tableName, [
//                $this->getPrimaryKeyName() => $this->valuesList(['pk'], true)
//            ], $this->params);
//        }

        return $this
            ->getQueryBuilder()
            ->delete()
            ->table($this->getModel()->tableName())
            ->setAlias(null)
            ->toSQL();
    }
1301597
protected function getQuery() {
        $query = '';

        foreach ($this->config['args'] as $index => $arg) {
            if (array_key_exists('command', $this->config) &&
                $arg === $this->config['command'] &&
                array_key_exists(($index + 1), $this->config['args'])) {
                $query = $this->config['args'][$index + 1];
                break;
            }
        }

        return $query;
    }
1230290
public function delete()
    {
        if (isset($this->onDelete)) {
            return call_user_func($this->onDelete, $this);
        }

        return $this->toBase()->delete();
    }
879618
protected function getDeleteQuery()
    {
        return $this->newQuery()->where([
            $this->foreignKey => $this->getAttribute($this->foreignKey),
            $this->relatedKey => $this->getAttribute($this->relatedKey),
        ]);
    }
667260
public static function delete()
    {
        $result = null;

        switch (static::getDriver()) {
            case self::DRIVER_MYSQL:
                $result = new \pwf\components\querybuilder\adapters\MySQL\DeleteBuilder();
                break;
            case self::DRIVER_PG:
                $result = new \pwf\components\querybuilder\adapters\PostgreSQL\DeleteBuilder();
                break;
            default:
                throw new \Exception('Wrong query builder driver');
        }

        return $result;
    }
144486
public function delete(): int
    {
        $this->builder->setDeleteAction();
        $sql = $this->builder->buildSql();
        $this->builder = new QueryBuilder($this->pdo);
        return $this->execSql($sql);
    }
415107
public function delete()
        {
            $query = array(
                "DELETE FROM",
                $this->_quoteIdentifier($this->_table_name)
            );

            $this->_addIdColumnConditions($query);

            return self::_execute(join(" ", $query), Arrays::is($this->id(true)) ? array_values($this->id(true)) : array($this->id(true)), $this->_connection_name);
        }
262883
public function delete()
	{
		$query = $this->getDeleteQuery();

		$query->where($this->morphType, $this->getAttribute($this->morphType));

		return $query->delete();
	}