abstract class AcsfMessageResponse in Acquia Cloud Site Factory Connector 8.2
Same name and namespace in other branches
- 8 src/AcsfMessageResponse.php \Drupal\acsf\AcsfMessageResponse
 
This simple interface defines the way that responses are constructed.
Hierarchy
- class \Drupal\acsf\AcsfMessageResponse
 
Expanded class hierarchy of AcsfMessageResponse
1 file declares its use of AcsfMessageResponse
File
- src/
AcsfMessageResponse.php, line 8  
Namespace
Drupal\acsfView source
abstract class AcsfMessageResponse {
  /**
   * The endpoint on the remote service.
   *
   * @var string
   */
  public $endpoint;
  /**
   * The response code from the remote call.
   *
   * @var mixed
   */
  public $code;
  /**
   * The body of the response.
   *
   * @var mixed
   */
  public $body;
  /**
   * Constructor.
   *
   * @param string $endpoint
   *   The endpoint on the remote service.
   * @param mixed $code
   *   The response code from the remote call.
   * @param mixed $body
   *   The body of the response.
   */
  public function __construct($endpoint, $code, $body) {
    if (empty($endpoint) || $code === NULL || $body === NULL) {
      throw new AcsfMessageMalformedResponseException('A response must contain an endpoint, a return code and a response body.');
    }
    $this->endpoint = $endpoint;
    $this->code = $code;
    $this->body = $body;
  }
  /**
   * Defines whether or not the call failed.
   *
   * Client code needs to analyze the response and determine failure.
   */
  public abstract function failed();
}Members
| 
            Name | 
                  Modifiers | Type | Description | Overrides | 
|---|---|---|---|---|
| 
            AcsfMessageResponse:: | 
                  public | property | The body of the response. | |
| 
            AcsfMessageResponse:: | 
                  public | property | The response code from the remote call. | |
| 
            AcsfMessageResponse:: | 
                  public | property | The endpoint on the remote service. | |
| 
            AcsfMessageResponse:: | 
                  abstract public | function | Defines whether or not the call failed. | 2 | 
| 
            AcsfMessageResponse:: | 
                  public | function | Constructor. |