src/Utilities/QueryBuilderUtility.php
public static function addParameters(QueryBuilder $queryBuilder, $parameters)
    {
        /*
         * No parameters?
         * Nothing to do
         */
        if (empty($parameters)) {
            return $queryBuilder;
        }

        foreach ($parameters as $key => $parameter) {
            $name = $key;
            $value = $parameter;

            if ($parameter instanceof Parameter) {
                $name = $parameter->getName();
                $value = $parameter->getValue();
            }

            $queryBuilder->setParameter($name, $value);
        }

        return $queryBuilder;
    }
public static function addParameters(QueryBuilder $queryBuilder, $parameters)
    {
        /*
         * No parameters?
         * Nothing to do
         */
        if (empty($parameters)) {
            return $queryBuilder;
        }

        foreach ($parameters as $key => $parameter) {
            $name = $key;
            $value = $parameter;

            if ($parameter instanceof Parameter) {
                $name = $parameter->getName();
                $value = $parameter->getValue();
            }

            $queryBuilder->setParameter($name, $value);
        }

        return $queryBuilder;
    }
public static function addParameters ( QueryBuilder $ queryBuilder , $ parameters ) { /*
         * No parameters?
         * Nothing to do
         */ if ( empty ( $ parameters ) ) { return $ queryBuilder ; } foreach ( $ parameters as $ key => $ parameter ) { $ name = $ key ; $ value = $ parameter ; if ( $ parameter instanceof Parameter ) { $ name = $ parameter -> getName ( ) ; $ value = $ parameter -> getValue ( ) ; } $ queryBuilder -> setParameter ( $ name , $ value ) ; } return $ queryBuilder ; }
Adds given parameters to given query builder.
Attention. Existing parameters will be overridden.

@param QueryBuilder          $queryBuilder The query builder
@param array|ArrayCollection $parameters   Parameters to add. Collection of Doctrine\ORM\Query\Parameter
instances or an array with key-value pairs.
@return QueryBuilder
Adds given parameters to given query builder . Attention . Existing parameters will be overridden .