AdWordsSoapClient::GetLastOperators PHP Method

GetLastOperators() public method

Gets the last set of operators the last call in the form of "operator1,operator2".
public GetLastOperators ( ) : string
return string the last set of operators
    public function GetLastOperators()
    {
        try {
            $operatorString = '{';
            $operators = array();
            $operatorElements = $this->GetLastRequestDom()->getElementsByTagName('operator');
            foreach ($operatorElements as $operatorElement) {
                if (array_key_exists($operatorElement->nodeValue, $operators)) {
                    $operators[$operatorElement->nodeValue] += 1;
                } else {
                    $operators[$operatorElement->nodeValue] = 1;
                }
            }
            foreach ($operators as $operator => $numOps) {
                $operatorString .= $operator . ': ' . $numOps . ', ';
            }
            if ($operatorString != '{') {
                $operatorString = substr($operatorString, 0, -2);
            }
            return $operatorString . '}';
        } catch (DOMException $e) {
            // TODO(api.arogal): Log failures to retrieve headers.
            return 'null';
        }
    }