src/DataDefinition/ModelRelationship/AbstractCondition.php
public static function checkCondition(ModelInterface $objParentModel, $arrFilter)
    {
        switch ($arrFilter['operation']) {
            case 'AND':
                return self::checkAndFilter($objParentModel, $arrFilter['children']);

            case 'OR':
                return self::checkOrFilter($objParentModel, $arrFilter['children']);

            case '=':
                return (self::getConditionValue($arrFilter, $objParentModel) == $arrFilter['value']);

            case '>':
                return (self::getConditionValue($arrFilter, $objParentModel) > $arrFilter['value']);

            case '<':
                return (self::getConditionValue($arrFilter, $objParentModel) < $arrFilter['value']);

            case 'IN':
                return \in_array($objParentModel->getProperty($arrFilter['property']), $arrFilter['values']);

            case 'LIKE':
                throw new DcGeneralRuntimeException('LIKE unsupported as of now.');

            default:
        }

        throw new DcGeneralRuntimeException(
            'Error processing filter array - unknown operation ' . \var_export($arrFilter, true),
            1
        );
    }
public static function checkCondition(ModelInterface $objParentModel, $arrFilter)
    {
        switch ($arrFilter['operation']) {
            case 'AND':
                return self::checkAndFilter($objParentModel, $arrFilter['children']);

            case 'OR':
                return self::checkOrFilter($objParentModel, $arrFilter['children']);

            case '=':
                return (self::getConditionValue($arrFilter, $objParentModel) == $arrFilter['value']);

            case '>':
                return (self::getConditionValue($arrFilter, $objParentModel) > $arrFilter['value']);

            case '<':
                return (self::getConditionValue($arrFilter, $objParentModel) < $arrFilter['value']);

            case 'IN':
                return \in_array($objParentModel->getProperty($arrFilter['property']), $arrFilter['values']);

            case 'LIKE':
                throw new DcGeneralRuntimeException('LIKE unsupported as of now.');

            default:
        }

        throw new DcGeneralRuntimeException(
            'Error processing filter array - unknown operation ' . \var_export($arrFilter, true),
            1
        );
    }
public static function checkCondition ( ModelInterface $ objParentModel , $ arrFilter ) { switch ( $ arrFilter [ 'operation' ] ) { case 'AND' : return self :: checkAndFilter ( $ objParentModel , $ arrFilter [ 'children' ] ) ; case 'OR' : return self :: checkOrFilter ( $ objParentModel , $ arrFilter [ 'children' ] ) ; case '=' : return ( self :: getConditionValue ( $ arrFilter , $ objParentModel ) == $ arrFilter [ 'value' ] ) ; case '>' : return ( self :: getConditionValue ( $ arrFilter , $ objParentModel ) > $ arrFilter [ 'value' ] ) ; case '<' : return ( self :: getConditionValue ( $ arrFilter , $ objParentModel ) < $ arrFilter [ 'value' ] ) ; case 'IN' : return \ in_array ( $ objParentModel -> getProperty ( $ arrFilter [ 'property' ] ) , $ arrFilter [ 'values' ] ) ; case 'LIKE' : throw new DcGeneralRuntimeException ( 'LIKE unsupported as of now.' ) ; default : } throw new DcGeneralRuntimeException ( 'Error processing filter array - unknown operation ' . \ var_export ( $ arrFilter , true ) , 1 ) ; }
Check if the passed filter rules apply to the given model.

@param ModelInterface $objParentModel The model to check the condition against.
@param array          $arrFilter      The condition filter to be applied.

@return bool

@throws DcGeneralRuntimeException When an unknown filter operation is encountered.
Check if the passed filter rules apply to the given model .