Google\Spreadsheet\Batch\BatchResponse::hasErrors PHP Method

hasErrors() public method

public hasErrors ( ) : boolean
return boolean
    public function hasErrors()
    {
        foreach ($this->xml->xpath("//batch:status/@code") as $el) {
            if ($el->__toString() !== "200") {
                return true;
            }
        }
        return false;
    }

Usage Example

 public function testHasErrors()
 {
     $this->assertFalse($this->batchResponse->hasErrors());
     $batchResponse = new BatchResponse($this->getSimpleXMLElement("batch-response-error"));
     $this->assertTrue($batchResponse->hasErrors());
 }