public function parse($json, Builder $querybuilder)
    {
        // do a JSON decode (throws exceptions if there is a JSON error...)
        $query = $this->decodeJSON($json);

        // This can happen if the querybuilder had no rules...
        if (!isset($query->rules) || !is_array($query->rules)) {
            return $querybuilder;
        }

        // This shouldn't ever cause an issue, but may as well not go through the rules.
        if (count($query->rules) < 1) {
            return $querybuilder;
        }

        return $this->loopThroughRules($query->rules, $querybuilder, $query->condition);
    }
public function parse($json, Builder $querybuilder)
    {
        // do a JSON decode (throws exceptions if there is a JSON error...)
        $query = $this->decodeJSON($json);

        // This can happen if the querybuilder had no rules...
        if (!isset($query->rules) || !is_array($query->rules)) {
            return $querybuilder;
        }

        // This shouldn't ever cause an issue, but may as well not go through the rules.
        if (count($query->rules) < 1) {
            return $querybuilder;
        }

        return $this->loopThroughRules($query->rules, $querybuilder, $query->condition);
    }
public function parse ( $ json , Builder $ querybuilder ) { // do a JSON decode (throws exceptions if there is a JSON error...) $ query = $ this -> decodeJSON ( $ json ) ; // This can happen if the querybuilder had no rules... if ( ! isset ( $ query -> rules ) || ! is_array ( $ query -> rules ) ) { return $ querybuilder ; } // This shouldn't ever cause an issue, but may as well not go through the rules. if ( count ( $ query -> rules ) < 1 ) { return $ querybuilder ; } return $ this -> loopThroughRules ( $ query -> rules , $ querybuilder , $ query -> condition ) ; }
QueryBuilderParser's parse function!

Build a query based on JSON that has been passed into the function, onto the builder passed into the function.

@param $json
@param Builder $querybuilder

@throws QBParseException

@return Builder
QueryBuilderParser s parse function!