Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Group BY

Open
#40 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
50/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Stale
Tech stack
php
Domain
backend, database

Research direction

Start by reading Editor.php, especially the _get($id = null, $http = null) method and the existing _ssp_query($query, $http) call. Confirm how query grouping is represented there, then verify that groupBy can set and retrieve the grouping and that generated queries apply it before the id condition.

Written by the indexing model from the issue text.

Description

No ficheiro Editor.php, adicionar procurar as linhas

/** @var string Action name allowing for configuration */
private $_actionName = 'action';

e adicionar após

/** @var string */
private $_group_by = '';

Adicionar a função

/**
 * @param string $column
 *
 * @return ($column is null ? string[] : $this) Where condition array.
 */
public function groupBy($column) {

    if ($column === null) {
        return $this->_group_by;
    }

    $this->_group_by = $column;

    return $this;
}

Na função
private function _get($id = null, $http = null)

Procurar a linha $ssp = $this->_ssp_query($query, $http); e adicionar depois da mesma

if($this->_group_by != '')
    $query->group_by($this->_group_by);

if ($id !== null) {
    $query->where($this->pkeyToArray($id, true));
}

Pode ser sempre melhorada foi uma alteração que fiz para poder usar o group by no editor

Dominant language
PHP
Stars
36
Forks
26
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from DataTables/PHP

All issues in DataTables/PHP

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.