src/FilterSetting/AbstractFromTo.php
private function createFromToRule(IAttribute $attribute, $formattedValueZero, $formattedValueOne)
    {
        // If something went wrong return an empty list.
        if ($formattedValueZero === false || $formattedValueOne === false) {
            return new StaticIdList([]);
        }

        // Add rule to the filter.
        $rule = $this->buildFromToRule($attribute);

        if (null !== $formattedValueOne) {
            $rule->setLowerBound($formattedValueZero, $this->get('moreequal'))
                ->setUpperBound($formattedValueOne, $this->get('lessequal'));
            return $rule;
        }
        if ($this->get('fromfield')) {
            $rule->setLowerBound($formattedValueZero, $this->get('moreequal'));
            return $rule;
        }
        $rule->setUpperBound($formattedValueZero, $this->get('lessequal'));

        return $rule;
    }
private function createFromToRule(IAttribute $attribute, $formattedValueZero, $formattedValueOne)
    {
        // If something went wrong return an empty list.
        if ($formattedValueZero === false || $formattedValueOne === false) {
            return new StaticIdList([]);
        }

        // Add rule to the filter.
        $rule = $this->buildFromToRule($attribute);

        if (null !== $formattedValueOne) {
            $rule->setLowerBound($formattedValueZero, $this->get('moreequal'))
                ->setUpperBound($formattedValueOne, $this->get('lessequal'));
            return $rule;
        }
        if ($this->get('fromfield')) {
            $rule->setLowerBound($formattedValueZero, $this->get('moreequal'));
            return $rule;
        }
        $rule->setUpperBound($formattedValueZero, $this->get('lessequal'));

        return $rule;
    }
private function createFromToRule ( IAttribute $ attribute , $ formattedValueZero , $ formattedValueOne ) { // If something went wrong return an empty list. if ( $ formattedValueZero === false || $ formattedValueOne === false ) { return new StaticIdList ( [ ] ) ; } // Add rule to the filter. $ rule = $ this -> buildFromToRule ( $ attribute ) ; if ( null !== $ formattedValueOne ) { $ rule -> setLowerBound ( $ formattedValueZero , $ this -> get ( 'moreequal' ) ) -> setUpperBound ( $ formattedValueOne , $ this -> get ( 'lessequal' ) ) ; return $ rule ; } if ( $ this -> get ( 'fromfield' ) ) { $ rule -> setLowerBound ( $ formattedValueZero , $ this -> get ( 'moreequal' ) ) ; return $ rule ; } $ rule -> setUpperBound ( $ formattedValueZero , $ this -> get ( 'lessequal' ) ) ; return $ rule ; }
Create and populate a rule instance.

@param IAttribute $attribute          The attribute to filter on.
@param string     $formattedValueZero The formatted first value.
@param string     $formattedValueOne  The formatted second value.

@return \MetaModels\FilterFromToBundle\FilterRule\FromTo|StaticIdList
Create and populate a rule instance .