Piwik\DataAccess\LogAggregator::getSelectDimensions PHP Method

getSelectDimensions() protected method

Returns the dimensions array, where (1) the table name is prepended to the field (2) the "AS label " is appended to the field
protected getSelectDimensions ( $dimensions, $tableName, boolean $appendSelectAs = true ) : mixed
$dimensions
$tableName
$appendSelectAs boolean
return mixed
    protected function getSelectDimensions($dimensions, $tableName, $appendSelectAs = true)
    {
        foreach ($dimensions as $selectAs => &$field) {
            $selectAsString = $field;
            if (!is_numeric($selectAs)) {
                $selectAsString = $selectAs;
            } else {
                // if function, do not alias or prefix
                if ($this->isFieldFunctionOrComplexExpression($field)) {
                    $selectAsString = $appendSelectAs = false;
                }
            }
            $isKnownField = !in_array($field, array('referrer_data'));
            if ($selectAsString == $field && $isKnownField) {
                $field = $this->prefixColumn($field, $tableName);
            }
            if ($appendSelectAs && $selectAsString) {
                $field = $this->prefixColumn($field, $tableName) . $this->getSelectAliasAs($selectAsString);
            }
        }
        return $dimensions;
    }