src/Charcoal/Source/AbstractSource.php
protected function parseFilterWithModel(FilterInterface $filter)
    {
        if ($this->hasModel()) {
            if ($filter->hasProperty()) {
                $model    = $this->model();
                $property = $filter->property();
                if (is_string($property) && $model->hasProperty($property)) {
                    $property = $model->property($property);

                    if ($property->l10n()) {
                        $filter->setProperty($property->l10nIdent());
                    }

                    if ($property->multiple()) {
                        $filter->setOperator('FIND_IN_SET');
                    }
                }
            }

            if ($filter instanceof FilterCollectionInterface) {
                $filter->traverseFilters(function (FilterInterface $expr) {
                    $this->parseFilterWithModel($expr);
                });
            }
        }

        return $filter;
    }
protected function parseFilterWithModel(FilterInterface $filter)
    {
        if ($this->hasModel()) {
            if ($filter->hasProperty()) {
                $model    = $this->model();
                $property = $filter->property();
                if (is_string($property) && $model->hasProperty($property)) {
                    $property = $model->property($property);

                    if ($property->l10n()) {
                        $filter->setProperty($property->l10nIdent());
                    }

                    if ($property->multiple()) {
                        $filter->setOperator('FIND_IN_SET');
                    }
                }
            }

            if ($filter instanceof FilterCollectionInterface) {
                $filter->traverseFilters(function (FilterInterface $expr) {
                    $this->parseFilterWithModel($expr);
                });
            }
        }

        return $filter;
    }
protected function parseFilterWithModel ( FilterInterface $ filter ) { if ( $ this -> hasModel ( ) ) { if ( $ filter -> hasProperty ( ) ) { $ model = $ this -> model ( ) ; $ property = $ filter -> property ( ) ; if ( is_string ( $ property ) && $ model -> hasProperty ( $ property ) ) { $ property = $ model -> property ( $ property ) ; if ( $ property -> l10n ( ) ) { $ filter -> setProperty ( $ property -> l10nIdent ( ) ) ; } if ( $ property -> multiple ( ) ) { $ filter -> setOperator ( 'FIND_IN_SET' ) ; } } } if ( $ filter instanceof FilterCollectionInterface ) { $ filter -> traverseFilters ( function ( FilterInterface $ expr ) { $ this -> parseFilterWithModel ( $ expr ) ; } ) ; } } return $ filter ; }
Process a query filter with the current model.

@param  FilterInterface $filter The expression object.
@return FilterInterface The parsed expression object.
Process a query filter with the current model .