Filter/FilterBuilderUpdater.php
protected function addFilters(FormInterface $form, QueryInterface $filterQuery, $alias = null)
    {
        /** @var $child FormInterface */
        foreach ($form->all() as $child) {
            $formType = $child->getConfig()->getType()->getInnerType();

            // this means we have a relation
            if ($child->getConfig()->hasAttribute('add_shared')) {
                $join = trim($alias . '.' . $child->getName(), '.');

                $addSharedClosure = $child->getConfig()->getAttribute('add_shared');

                if (!$addSharedClosure instanceof \Closure) {
                    throw new \RuntimeException('Please provide a closure to the "add_shared" option.');
                }

                $qbe = new FilterBuilderExecuter($filterQuery, $alias, $this->parts);
                $addSharedClosure($qbe);

                if (!$this->parts->has($join)) {
                    throw new \RuntimeException(sprintf('No alias found for relation "%s".', $join));
                }

                $isCollection = ($formType instanceof CollectionAdapterFilterType);

                $this->addFilters($isCollection ? $child->get(0) : $child, $filterQuery, $this->parts->get($join));

            // Doctrine2 embedded object case
            } elseif ($formType instanceof EmbeddedFilterTypeInterface) {
                $this->addFilters($child, $filterQuery, $alias . '.' . $child->getName());

            // default case
            } else {
                $condition = $this->getFilterCondition($child, $formType, $filterQuery, $alias);

                if ($condition instanceof ConditionInterface) {
                    $this->conditionBuilder->addCondition($condition);
                }
            }
        }
    }
protected function addFilters(FormInterface $form, QueryInterface $filterQuery, $alias = null)
    {
        /** @var $child FormInterface */
        foreach ($form->all() as $child) {
            $formType = $child->getConfig()->getType()->getInnerType();

            // this means we have a relation
            if ($child->getConfig()->hasAttribute('add_shared')) {
                $join = trim($alias . '.' . $child->getName(), '.');

                $addSharedClosure = $child->getConfig()->getAttribute('add_shared');

                if (!$addSharedClosure instanceof \Closure) {
                    throw new \RuntimeException('Please provide a closure to the "add_shared" option.');
                }

                $qbe = new FilterBuilderExecuter($filterQuery, $alias, $this->parts);
                $addSharedClosure($qbe);

                if (!$this->parts->has($join)) {
                    throw new \RuntimeException(sprintf('No alias found for relation "%s".', $join));
                }

                $isCollection = ($formType instanceof CollectionAdapterFilterType);

                $this->addFilters($isCollection ? $child->get(0) : $child, $filterQuery, $this->parts->get($join));

            // Doctrine2 embedded object case
            } elseif ($formType instanceof EmbeddedFilterTypeInterface) {
                $this->addFilters($child, $filterQuery, $alias . '.' . $child->getName());

            // default case
            } else {
                $condition = $this->getFilterCondition($child, $formType, $filterQuery, $alias);

                if ($condition instanceof ConditionInterface) {
                    $this->conditionBuilder->addCondition($condition);
                }
            }
        }
    }
protected function addFilters ( FormInterface $ form , QueryInterface $ filterQuery , $ alias = null ) { /** @var $child FormInterface */ foreach ( $ form -> all ( ) as $ child ) { $ formType = $ child -> getConfig ( ) -> getType ( ) -> getInnerType ( ) ; // this means we have a relation if ( $ child -> getConfig ( ) -> hasAttribute ( 'add_shared' ) ) { $ join = trim ( $ alias . '.' . $ child -> getName ( ) , '.' ) ; $ addSharedClosure = $ child -> getConfig ( ) -> getAttribute ( 'add_shared' ) ; if ( ! $ addSharedClosure instanceof \ Closure ) { throw new \ RuntimeException ( 'Please provide a closure to the "add_shared" option.' ) ; } $ qbe = new FilterBuilderExecuter ( $ filterQuery , $ alias , $ this -> parts ) ; $ addSharedClosure ( $ qbe ) ; if ( ! $ this -> parts -> has ( $ join ) ) { throw new \ RuntimeException ( sprintf ( 'No alias found for relation "%s".' , $ join ) ) ; } $ isCollection = ( $ formType instanceof CollectionAdapterFilterType ) ; $ this -> addFilters ( $ isCollection ? $ child -> get ( 0 ) : $ child , $ filterQuery , $ this -> parts -> get ( $ join ) ) ; // Doctrine2 embedded object case } elseif ( $ formType instanceof EmbeddedFilterTypeInterface ) { $ this -> addFilters ( $ child , $ filterQuery , $ alias . '.' . $ child -> getName ( ) ) ; // default case } else { $ condition = $ this -> getFilterCondition ( $ child , $ formType , $ filterQuery , $ alias ) ; if ( $ condition instanceof ConditionInterface ) { $ this -> conditionBuilder -> addCondition ( $ condition ) ; } } } }
Add filter conditions on the condition node instance.

@param FormInterface  $form
@param QueryInterface $filterQuery
@param string         $alias

@throws \RuntimeException
Add filter conditions on the condition node instance .