@param Builder $table

@return Builder
334906
public function apply(Builder $table)
    {
        return $table
            ->offset(($this->currentPage - 1) * $this->itemsPerPage)
            ->limit($this->itemsPerPage);
    }
289314
protected function exportableQuery(Builder $query): Builder
    {
        // Allow executing custom exportable query.
        if (method_exists($this->module, 'exportableQuery')) {
            return $this->module->exportableQuery($query);
        }

        return $query
            ->when($query->getModel() instanceof Translatable, function ($query) {
                $query->translated();
            })
            // leave select after joining with translations
            // table in order to rewrite selected columns
            ->select($this->exportableColumns());
    }
1245806
protected function setTable($table)
    {
        $this->table = $table;
        $this->quotedTable = $this->dialect->quote($table, 'name');
        return $this;
    }
1094441
public function apply(Builder $builder)
    {
        $this->builder = $builder;

        foreach (array_filter($this->filters()) as $name => $value) {
            if (method_exists($this, $name)) {
                call_user_func_array([$this, $name], [$value]);
            }
        }

        return $this->builder;
    }
715615
public function get(Builder $builder)
    {
        return $this->map(
            $builder, $this->search($builder), $builder->model
        );
    }
302364
public function apply(Builder $table)
    {
        $table = parent::apply($table);
        if ($this->exclude) {
            $table = $table->where($this->excludedColumnName, '!=', $this->exclude);
        }

        return $table;
    }
151132
public function buildQuery(Builder $query = null): Builder
    {
        $query = $this->getSubQuery($this->meta, $query, $this->conditions['rules'], $this->conditions['condition']);

        if ($this->offset > 0) {
            $query->offset($this->offset);
        }
        if ($this->limit > 0) {
            $query->limit($this->limit);
        }

        return $query;
    }
272648
public function apply(Builder $builder)
    {
        $this->builder = $builder;

        // We need to select all columns from the original
        // table, since many joins can mess up the selected fields
        $this->builder->select("{$this->getTableName()}.*");

        foreach ($this->filters() as $name => $value) {
            $this->callFilterMethod($name, $value);
        }

        return $this->builder;
    }
222320
public static Builder newBuilder(TableId table, RowToInsert... rows) {
    return newBuilder(table, ImmutableList.copyOf(rows));
  }
460141
public function table($table) {
        $query = new Builder($this, $this->getQueryGrammar());

        return $query->from($table);
    }
437785
public static Builder newBuilder(TableId table, Iterable<RowToInsert> rows) {
    return newBuilder(table).setRows(rows);
  }
410753
public function createFromBuilder(Builder $builder)
    {
        $this->model = $builder->getModel();
        $this->query = $builder;

        $this->build();

        return $this;
    }
108728
public static function builder($builder = null)
    {
        if (is_object($builder)) {
            self::$builder = $builder;
        }

        return isset(self::$builder) ? self::$builder : self::$builder = new Builder;
    }
433266
public function createTable(Table $table)
    {
        if (!$table->hasOption('charset') && !$table->hasOption('collate')) {
            $connParams = $this->_conn->getParams();
            if (isset($connParams['defaultTableOptions']['charset']) && isset($connParams['defaultTableOptions']['collate'])) {
                $table
                    ->addOption('charset', $connParams['defaultTableOptions']['charset'])
                    ->addOption('collate', $connParams['defaultTableOptions']['collate'])
                ;
            }
        }

        return parent::createTable($table);
    }
911424
protected function addUnordered(Builder $builder)
    {
        $builder->macro('unordered', function (Builder $builder) {

            $this->remove($builder, $builder->getModel());
            return $builder;
        });
    }
1316719
public function update($table)
    {
        $this->type  = 'UPDATE';
        $this->table = $this->quoteName($table);
        return $this;
    }
801604
public function delete(string $table) : QueryBuilder
    {
        $this->_query[] = "DELETE FROM";
        $this->_query[] = "`". $this->sanitize($table) ."`";

        return $this;
    }