CI_DB_query_builder::group_by PHP Méthode

group_by() public méthode

GROUP BY
public group_by ( string $by, boolean $escape = NULL ) : CI_DB_query_builder
$by string
$escape boolean
Résultat CI_DB_query_builder
    public function group_by($by, $escape = NULL)
    {
        is_bool($escape) or $escape = $this->_protect_identifiers;
        if (is_string($by)) {
            $by = $escape === TRUE ? explode(',', $by) : array($by);
        }
        foreach ($by as $val) {
            $val = trim($val);
            if ($val !== '') {
                $val = array('field' => $val, 'escape' => $escape);
                $this->qb_groupby[] = $val;
                if ($this->qb_caching === TRUE) {
                    $this->qb_cache_groupby[] = $val;
                    $this->qb_cache_exists[] = 'groupby';
                }
            }
        }
        return $this;
    }