You are here

class RestResponseResources in Salesforce Suite 8.4

Same name and namespace in other branches
  1. 8.3 src/Rest/RestResponseResources.php \Drupal\salesforce\Rest\RestResponseResources
  2. 5.0.x src/Rest/RestResponseResources.php \Drupal\salesforce\Rest\RestResponseResources

Class RestResponseResources.

@package Drupal\salesforce\Rest

Hierarchy

Expanded class hierarchy of RestResponseResources

1 file declares its use of RestResponseResources
RestClientTest.php in tests/src/Unit/RestClientTest.php

File

src/Rest/RestResponseResources.php, line 10

Namespace

Drupal\salesforce\Rest
View source
class RestResponseResources extends RestResponse {

  /**
   * List of API endpoint paths.
   *
   * Accessible via RestResponse:__get()
   *
   * @var array
   */
  protected $resources;

  /**
   * RestResponseResources constructor.
   *
   * See https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_discoveryresource.htm.
   *
   * @param \Drupal\salesforce\Rest\RestResponse $response
   *   The response.
   */
  public function __construct(RestResponse $response) {
    parent::__construct($response->response);
    foreach ($response->data as $key => $path) {
      $this->resources[$key] = $path;
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
RestResponse::$data protected property The json-decoded response body.
RestResponse::$response protected property The original Response used to build this object.
RestResponse::handleJsonResponse private function Helper function to eliminate repetitive json parsing.
RestResponse::__get public function Magic getter method to return the given property.
RestResponseResources::$resources protected property List of API endpoint paths.
RestResponseResources::__construct public function RestResponseResources constructor. Overrides RestResponse::__construct
StringTranslationTrait::$stringTranslation protected property The string translation service. 1
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.