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

setData() public method

Sets the callback content data.
public setData ( mixed $data )
$data mixed Data that will be set into output 'data' field.
    public function setData($data)
    {
        $this->outputArray['data'] = $data;
        return $this;
    }

Usage Example

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