Webiny\Component\Rest\Response\CallbackResult::getError PHP Method

getError() public method

If there are errors, error report array is returned, otherwise false.
public getError ( ) : boolean | array
return boolean | array
    public function getError()
    {
        return empty($this->outputArray['errorReport']) ? false : $this->outputArray['errorReport'];
    }

Usage Example

示例#1
0
 public function testGetErrorFalse()
 {
     $obj = new \stdClass();
     $obj->title = 'Rock star';
     $cr = new CallbackResult();
     $cr->setData($obj);
     $this->assertFalse($cr->getError());
 }