Newscoop\Doctrine\AdoDbAdapter::getCol PHP 메소드

getCol() 공개 메소드

Execute sql query and returns all elements of the first column.
public getCol ( string $sql, array $params = [] ) : array
$sql string
$params array
리턴 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;
    }