original_string: protected function addFilterToQueryBuilder(array $filter, QueryBuilder $queryBuilder)
      {
          $objectManager    = $this->getObjectManager();
          $entityClassAlias = $this->getEntityClassAlias();
          $classMetaData    = $objectManager->getClassMetadata($this->getEntityClass());
          $assocMappings    = $classMetaData->getAssociationMappings();
  
          $andExpressions = array();
          $paramCounter   = 0;
  
          foreach ($filter as $property => $value) {
              if (empty($value)) {
                  continue;
              }
  
              if (!isset($assocMappings[$property])) {
                  throw new \InvalidArgumentException('Unkown association "' . $property . '"');
              }
              $paramCounter++;
              $queryBuilder->andWhere($queryBuilder->expr()->eq($entityClassAlias . '.' .$property, '?' . $paramCounter));
              $queryBuilder->setParameter($paramCounter, $value);
  
          }
  
          return $paramCounter;
      }
code: protected function addFilterToQueryBuilder(array $filter, QueryBuilder $queryBuilder)
      {
          $objectManager    = $this->getObjectManager();
          $entityClassAlias = $this->getEntityClassAlias();
          $classMetaData    = $objectManager->getClassMetadata($this->getEntityClass());
          $assocMappings    = $classMetaData->getAssociationMappings();
  
          $andExpressions = array();
          $paramCounter   = 0;
  
          foreach ($filter as $property => $value) {
              if (empty($value)) {
                  continue;
              }
  
              if (!isset($assocMappings[$property])) {
                  throw new \InvalidArgumentException('Unkown association "' . $property . '"');
              }
              $paramCounter++;
              $queryBuilder->andWhere($queryBuilder->expr()->eq($entityClassAlias . '.' .$property, '?' . $paramCounter));
              $queryBuilder->setParameter($paramCounter, $value);
  
          }
  
          return $paramCounter;
      }
code_tokens: protected function addFilterToQueryBuilder ( array $ filter , QueryBuilder $ queryBuilder ) { $ objectManager = $ this -> getObjectManager ( ) ; $ entityClassAlias = $ this -> getEntityClassAlias ( ) ; $ classMetaData = $ objectManager -> getClassMetadata ( $ this -> getEntityClass ( ) ) ; $ assocMappings = $ classMetaData -> getAssociationMappings ( ) ; $ andExpressions = array ( ) ; $ paramCounter = 0 ; foreach ( $ filter as $ property => $ value ) { if ( empty ( $ value ) ) { continue ; } if ( ! isset ( $ assocMappings [ $ property ] ) ) { throw new \ InvalidArgumentException ( 'Unkown association "' . $ property . '"' ) ; } $ paramCounter ++ ; $ queryBuilder -> andWhere ( $ queryBuilder -> expr ( ) -> eq ( $ entityClassAlias . '.' . $ property , '?' . $ paramCounter ) ) ; $ queryBuilder -> setParameter ( $ paramCounter , $ value ) ; } return $ paramCounter ; }
docstring: Adds filter conditions to query bilder
  
  @param array $filter
  @param QueryBuilder $queryBuilder
  @throws \InvalidArgumentException
  @return integer
docstring_tokens: Adds filter conditions to query bilder