title: Dynamic Arguments in Doctrine andX()
body: <p>I´m looking for a solution to <strong>make the andX part of a doctrine DQL statement dynamic</strong> according to passed arguments:</p>
  
  <pre><code>private function getDiscountPrice(int $weighting, Article $article, Customer $customer, array $args) {
  
  // Get the query builder
  $qb = Shopware()-&gt;Models()-&gt;createQueryBuilder();
  $params = new ArrayCollection();
  
  foreach($args as $key =&gt; $arg):
      $params-&gt;set($key,$arg);
  endforeach;
  
  $qb-&gt;select('discount')
      -&gt;from('PhaBase\Models\Discount','discount')
      -&gt;where(
          $qb-&gt;expr()-&gt;andX(
                  $qb-&gt;expr()-&gt;eq('discount.kdNr',':kdNr'),
                  $qb-&gt;expr()-&gt;eq('discount.pzn',':pzn'),
                  $qb-&gt;expr()-&gt;isNotNull('discount.kdNr'),
                  $qb-&gt;expr()-&gt;isNotNull('discount.pzn')
          )
      )
      -&gt;setParameters($params-&gt;toArray());
  
  $discount = null;
  
  try {
      $discount = $qb-&gt;getQuery()-&gt;getOneOrNullResult();
  } catch (NonUniqueResultException $e) {
      // @TODO Add log entry to inform about Exception
      return null;
  }
  </code></pre>
  
  <p>I want to build the content for the andX() argument in the same way like the Parameters, but I don´t know how to pass dynamic arguments to this method.</p>
  
  <p>Thanks for any ideas,
  Michael</p>