Drest\Query\ExposeFields::recurseExposeString PHP Method

recurseExposeString() protected method

Recursively process the passed expose string
protected recurseExposeString ( string $string, array &$results )
$string string - the string to be processed
$results array - passed by reference
    protected function recurseExposeString($string, &$results)
    {
        if (substr_count($string, '[') !== substr_count($string, ']')) {
            throw InvalidExposeFieldsException::unableToParseExposeString($string);
        }
        $results = (array) $results;
        $parts = $this->parseStringParts($string);
        foreach ($parts->parts as $part) {
            $this->recurseExposeString($part['contents'], $results[$part['tagName']]);
        }
        $results = array_merge(array_filter(explode('|', $parts->remaining_string), function ($item) {
            return empty($item) ? false : true;
        }), $results);
    }