public function isAnInExpression(TreeExpression $expr)
    {
        $count = $expr->count();
        if ($count <= 1 || strtolower($expr->getValue()) != 'or' )
            return false;

        $children = $expr->getChildren();
        if (!$children[0] instanceof FieldExpression)
            return false;

        for ($i = 1; $i < $count; $i++) {
            if (!$children[$i] instanceof FieldExpression)
                return false;
            if ($children[$i]->getField() != $children[$i-1]->getField())
                return false;
        }

        return true;
    }
public function isAnInExpression(TreeExpression $expr)
    {
        $count = $expr->count();
        if ($count <= 1 || strtolower($expr->getValue()) != 'or' )
            return false;

        $children = $expr->getChildren();
        if (!$children[0] instanceof FieldExpression)
            return false;

        for ($i = 1; $i < $count; $i++) {
            if (!$children[$i] instanceof FieldExpression)
                return false;
            if ($children[$i]->getField() != $children[$i-1]->getField())
                return false;
        }

        return true;
    }
public function isAnInExpression ( TreeExpression $ expr ) { $ count = $ expr -> count ( ) ; if ( $ count <= 1 || strtolower ( $ expr -> getValue ( ) ) != 'or' ) return false ; $ children = $ expr -> getChildren ( ) ; if ( ! $ children [ 0 ] instanceof FieldExpression ) return false ; for ( $ i = 1 ; $ i < $ count ; $ i ++ ) { if ( ! $ children [ $ i ] instanceof FieldExpression ) return false ; if ( $ children [ $ i ] -> getField ( ) != $ children [ $ i - 1 ] -> getField ( ) ) return false ; } return true ; }
Can be the tree expression converted in a "FIELD IN ..." expression?
@param TreeExpression $expr
@return bool
Can be the tree expression converted in a FIELD IN ... expression?