public function columns(array $fields, QueryParameters $queryParameters = null) {
        $select = '';
        foreach($fields as $field) {
            $select .= 'o.' . $field;
            if($field !== last($fields)) {
                $select .= ', ';
            }
        }
        $qb = $this->entities->createQueryBuilder()
            ->select($select)
            ->from($this->entityName, 'o');

        return $this->getQuery($qb, $queryParameters)->getResult();
    }
public function columns(array $fields, QueryParameters $queryParameters = null) {
        $select = '';
        foreach($fields as $field) {
            $select .= 'o.' . $field;
            if($field !== last($fields)) {
                $select .= ', ';
            }
        }
        $qb = $this->entities->createQueryBuilder()
            ->select($select)
            ->from($this->entityName, 'o');

        return $this->getQuery($qb, $queryParameters)->getResult();
    }
public function columns ( array $ fields , QueryParameters $ queryParameters = null ) { $ select = '' ; foreach ( $ fields as $ field ) { $ select .= 'o.' . $ field ; if ( $ field !== last ( $ fields ) ) { $ select .= ', ' ; } } $ qb = $ this -> entities -> createQueryBuilder ( ) -> select ( $ select ) -> from ( $ this -> entityName , 'o' ) ; return $ this -> getQuery ( $ qb , $ queryParameters ) -> getResult ( ) ; }
Retrieves certain columns of entities.

@param array           $fields
@param QueryParameters $queryParameters an optional array of query scopes
@return mixed
Retrieves certain columns of entities .