public function setBody($responseBody)
	{
		if($this->initialized !== true)
			throw new \Exception('ResponseBuilder not initialized. Call init() first');
		
		// TODO make sure, this can only be a string or a BaseObject
		// TODO throws an error when not valid JSON - how to deal with this?
		if(gettype($responseBody) != 'string')
			$responseBody = $responseBody->getJSONString();
		
		$this->sonicResponse->setBody($responseBody);
		
		return $this;
	}
public function setBody($responseBody)
	{
		if($this->initialized !== true)
			throw new \Exception('ResponseBuilder not initialized. Call init() first');
		
		// TODO make sure, this can only be a string or a BaseObject
		// TODO throws an error when not valid JSON - how to deal with this?
		if(gettype($responseBody) != 'string')
			$responseBody = $responseBody->getJSONString();
		
		$this->sonicResponse->setBody($responseBody);
		
		return $this;
	}
public function setBody ( $ responseBody ) { if ( $ this -> initialized !== true ) throw new \ Exception ( 'ResponseBuilder not initialized. Call init() first' ) ; // TODO make sure, this can only be a string or a BaseObject
 // TODO throws an error when not valid JSON - how to deal with this?
 if ( gettype ( $ responseBody ) != 'string' ) $ responseBody = $ responseBody -> getJSONString ( ) ; $ this -> sonicResponse -> setBody ( $ responseBody ) ; return $ this ; }
Sets the payload for the response. This needs to be an object that inherits from BasicObject
Sets the payload for the response . This needs to be an object that inherits from BasicObject