src/Soluble/Db/Sql/Select.php
public function prefixedColumns(array $columns)
    {
        $pf = $this->adapter->getPlatform();
        $identifierSeparator = $pf->getIdentifierSeparator();
        $names = [];
        $cols = [];
        foreach ($columns as $alias => $column) {
            if (is_string($column)) {
                if (strpos($column, self::SQL_STAR) !== false) {
                    $msg = __METHOD__ . " Invalid argument, prefixedColumn() does not accept sql * column specification";
                    throw new Exception\InvalidArgumentException($msg);
                }
                $parts = explode($identifierSeparator, $column);
                if (count($parts) > 1) {
                    $quotedParts = [];
                    foreach ($parts as $part) {
                        $quotedParts[] = $pf->quoteIdentifier($part);
                    }
                    // to remove PHPAnalyzer warnings
                    //var_dump($quotedParts[count($quotedParts)-1]);
                    //die();
                    $last_part = $parts[count($parts)-1];

                    if (!is_string($alias)) {
                        $alias = $last_part;
                    }

                    if (in_array($alias, $names)) {
                        $msg = __METHOD__ . ": Invalid argument, multiple columns have the same alias ($alias)";
                        throw new Exception\InvalidArgumentException($msg);
                    }
                    $names[] = $alias;

                    $cols[$alias] = new Expression(implode($identifierSeparator, $quotedParts));
                } else {
                    if (in_array($alias, $names)) {
                        $msg = __METHOD__ . ": Invalid argument, multiple columns have the same alias ($alias)";
                        throw new Exception\InvalidArgumentException($msg);
                    }

                    $cols[$alias] = $column;
                    $names[] = $alias;
                }
            } else {
                if (in_array($alias, $names)) {
                    $msg = __METHOD__ . ": Invalid argument, multiple columns have the same alias ($alias)";
                    throw new Exception\InvalidArgumentException($msg);
                }

                $cols[$alias] = $column;
                $names[] = $alias;
            }
        }
        $this->columns($cols);
        return $this;
    }
public function prefixedColumns(array $columns)
    {
        $pf = $this->adapter->getPlatform();
        $identifierSeparator = $pf->getIdentifierSeparator();
        $names = [];
        $cols = [];
        foreach ($columns as $alias => $column) {
            if (is_string($column)) {
                if (strpos($column, self::SQL_STAR) !== false) {
                    $msg = __METHOD__ . " Invalid argument, prefixedColumn() does not accept sql * column specification";
                    throw new Exception\InvalidArgumentException($msg);
                }
                $parts = explode($identifierSeparator, $column);
                if (count($parts) > 1) {
                    $quotedParts = [];
                    foreach ($parts as $part) {
                        $quotedParts[] = $pf->quoteIdentifier($part);
                    }
                    // to remove PHPAnalyzer warnings
                    //var_dump($quotedParts[count($quotedParts)-1]);
                    //die();
                    $last_part = $parts[count($parts)-1];

                    if (!is_string($alias)) {
                        $alias = $last_part;
                    }

                    if (in_array($alias, $names)) {
                        $msg = __METHOD__ . ": Invalid argument, multiple columns have the same alias ($alias)";
                        throw new Exception\InvalidArgumentException($msg);
                    }
                    $names[] = $alias;

                    $cols[$alias] = new Expression(implode($identifierSeparator, $quotedParts));
                } else {
                    if (in_array($alias, $names)) {
                        $msg = __METHOD__ . ": Invalid argument, multiple columns have the same alias ($alias)";
                        throw new Exception\InvalidArgumentException($msg);
                    }

                    $cols[$alias] = $column;
                    $names[] = $alias;
                }
            } else {
                if (in_array($alias, $names)) {
                    $msg = __METHOD__ . ": Invalid argument, multiple columns have the same alias ($alias)";
                    throw new Exception\InvalidArgumentException($msg);
                }

                $cols[$alias] = $column;
                $names[] = $alias;
            }
        }
        $this->columns($cols);
        return $this;
    }
Add table prefixed columns, will automatically
quote table parts identifiers found in the column name.
It provides an alternative for defining columns from multiple/joined
table in one go.

<code>
$select->from(array('p' =>'product')
->prefixedColumns(array('product_title' => 'p.title'));
</code>
Possible valid states:
array(value, ...)
value can be strings or Expression objects

array(string => value, ...)
key string will be use as alias,
value can be string or Expression objects

@throws Exception\InvalidArgumentException when usage not correct
@param  array $columns
@return Select