src/DataTable.php
protected function toSQLColumn($column, $onlyAlias = 0, $filter = false)
    {
        if (!isset($column['sql_name']) && !isset($column['data'])) {
            self::sendFatal('Houston, we have a problem with one of your column : can\'t draw it SQL name because it don\'t have data or sql_name define.'."\n".json_encode($column));
        }

        if ($filter && isset($column['sFilter']) && isset($column['sFilter']['sql_name'])) {
            return $this->toSQLColumn($column['sFilter'], $onlyAlias, false);
        }

        $quote = !isset($column['protect_sql']) || $column['protect_sql']  ? '`' : '';
        // Alias ne correspondrait pas à Name ?!!!!
        $table = isset($column['sql_table']) ? $column['sql_table'] : $this->aliasTable;

        return $onlyAlias === 1 && isset($column['alias']) ?
                    $column['alias'] :
                    $quote.$table.$quote.(empty($table) ? '' : '.')
                        .$quote.(isset($column['sql_name']) ? $column['sql_name'] : $column['data']).$quote
                    .($onlyAlias === 0 && isset($column['alias']) ? ' AS '.$column['alias'] : '');
    }
protected function toSQLColumn($column, $onlyAlias = 0, $filter = false)
    {
        if (!isset($column['sql_name']) && !isset($column['data'])) {
            self::sendFatal('Houston, we have a problem with one of your column : can\'t draw it SQL name because it don\'t have data or sql_name define.'."\n".json_encode($column));
        }

        if ($filter && isset($column['sFilter']) && isset($column['sFilter']['sql_name'])) {
            return $this->toSQLColumn($column['sFilter'], $onlyAlias, false);
        }

        $quote = !isset($column['protect_sql']) || $column['protect_sql']  ? '`' : '';
        // Alias ne correspondrait pas à Name ?!!!!
        $table = isset($column['sql_table']) ? $column['sql_table'] : $this->aliasTable;

        return $onlyAlias === 1 && isset($column['alias']) ?
                    $column['alias'] :
                    $quote.$table.$quote.(empty($table) ? '' : '.')
                        .$quote.(isset($column['sql_name']) ? $column['sql_name'] : $column['data']).$quote
                    .($onlyAlias === 0 && isset($column['alias']) ? ' AS '.$column['alias'] : '');
    }
protected function toSQLColumn ( $ column , $ onlyAlias = 0 , $ filter = false ) { if ( ! isset ( $ column [ 'sql_name' ] ) && ! isset ( $ column [ 'data' ] ) ) { self :: sendFatal ( 'Houston, we have a problem with one of your column : can\'t draw it SQL name because it don\'t have data or sql_name define.' . "\n" . json_encode ( $ column ) ) ; } if ( $ filter && isset ( $ column [ 'sFilter' ] ) && isset ( $ column [ 'sFilter' ] [ 'sql_name' ] ) ) { return $ this -> toSQLColumn ( $ column [ 'sFilter' ] , $ onlyAlias , false ) ; } $ quote = ! isset ( $ column [ 'protect_sql' ] ) || $ column [ 'protect_sql' ] ? '`' : '' ; // Alias ne correspondrait pas à Name ?!!!! $ table = isset ( $ column [ 'sql_table' ] ) ? $ column [ 'sql_table' ] : $ this -> aliasTable ; return $ onlyAlias === 1 && isset ( $ column [ 'alias' ] ) ? $ column [ 'alias' ] : $ quote . $ table . $ quote . ( empty ( $ table ) ? '' : '.' ) . $ quote . ( isset ( $ column [ 'sql_name' ] ) ? $ column [ 'sql_name' ] : $ column [ 'data' ] ) . $ quote . ( $ onlyAlias === 0 && isset ( $ column [ 'alias' ] ) ? ' AS ' . $ column [ 'alias' ] : '' ) ; }
Give a column's sql name

@param array $column
@param int   $onlyAlias 0: return sql_table.sql_name AS alias
1: return alias
2: return sql_table.sql_name
@param bool  $filter

@return string
Give a column s sql name