CI_DB_active_record::_max_min_avg_sum PHP Méthode

_max_min_avg_sum() public méthode

select_max() select_min() select_avg() select_sum()
public _max_min_avg_sum ( $select = '', $alias = '', $type = 'MAX' ) : object
Résultat object
    function _max_min_avg_sum($select = '', $alias = '', $type = 'MAX')
    {
        if (!is_string($select) or $select == '') {
            $this->display_error('db_invalid_query');
        }
        $type = strtoupper($type);
        if (!in_array($type, array('MAX', 'MIN', 'AVG', 'SUM'))) {
            show_error('Invalid function type: ' . $type);
        }
        if ($alias == '') {
            $alias = $this->_create_alias_from_table(trim($select));
        }
        $sql = $type . '(' . $this->_protect_identifiers(trim($select)) . ') AS ' . $alias;
        $this->ar_select[] = $sql;
        if ($this->ar_caching === TRUE) {
            $this->ar_cache_select[] = $sql;
            $this->ar_cache_exists[] = 'select';
        }
        return $this;
    }