Newscoop\Doctrine\AdoDbAdapter::getCol PHP Method

getCol() public method

Execute sql query and returns all elements of the first column.
public getCol ( string $sql, array $params = [] ) : array
$sql string
$params array
return array
    public function getCol($sql, array $params = array())
    {
        $return = array();
        $rows = $this->connection->fetchAll($sql, $params);
        foreach ($rows as $row) {
            $return[] = reset($row);
        }
        return $return;
    }