src/Data/DefaultDataProviderDBalUtils.php
public static function addField(ConfigInterface $config, $idProperty, QueryBuilder $queryBuilder)
    {
        if ($config->getIdOnly()) {
            $queryBuilder->select($idProperty);
            return;
        }

        if (null !== $config->getFields()) {
            $connection = $queryBuilder->getConnection();
            $fields     = implode(
                ', ',
                array_map(
                    function ($field) use ($connection) {
                        return $connection->quoteIdentifier($field);
                    },
                    $config->getFields()
                )
            );

            if (false !== stripos($fields, 'DISTINCT') || \in_array($idProperty, $config->getFields(), true)) {
                $queryBuilder->select($fields);
                return;
            }

            $queryBuilder->select($idProperty . ', ' . $fields);
            return;
        }

        $queryBuilder->select('*');
    }
public static function addField(ConfigInterface $config, $idProperty, QueryBuilder $queryBuilder)
    {
        if ($config->getIdOnly()) {
            $queryBuilder->select($idProperty);
            return;
        }

        if (null !== $config->getFields()) {
            $connection = $queryBuilder->getConnection();
            $fields     = implode(
                ', ',
                array_map(
                    function ($field) use ($connection) {
                        return $connection->quoteIdentifier($field);
                    },
                    $config->getFields()
                )
            );

            if (false !== stripos($fields, 'DISTINCT') || \in_array($idProperty, $config->getFields(), true)) {
                $queryBuilder->select($fields);
                return;
            }

            $queryBuilder->select($idProperty . ', ' . $fields);
            return;
        }

        $queryBuilder->select('*');
    }
public static function addField ( ConfigInterface $ config , $ idProperty , QueryBuilder $ queryBuilder ) { if ( $ config -> getIdOnly ( ) ) { $ queryBuilder -> select ( $ idProperty ) ; return ; } if ( null !== $ config -> getFields ( ) ) { $ connection = $ queryBuilder -> getConnection ( ) ; $ fields = implode ( ', ' , array_map ( function ( $ field ) use ( $ connection ) { return $ connection -> quoteIdentifier ( $ field ) ; } , $ config -> getFields ( ) ) ) ; if ( false !== stripos ( $ fields , 'DISTINCT' ) || \ in_array ( $ idProperty , $ config -> getFields ( ) , true ) ) { $ queryBuilder -> select ( $ fields ) ; return ; } $ queryBuilder -> select ( $ idProperty . ', ' . $ fields ) ; return ; } $ queryBuilder -> select ( '*' ) ; }
Add the field list.

Returns all values from $objConfig->getFields() as comma separated list.

@param ConfigInterface $config       The configuration to use.
@param string          $idProperty   The name of the id property.
@param QueryBuilder    $queryBuilder The query builder.

@return void
Add the field list .