You are here

class AuthorizationResponse in Authorization 8

Response object for the output of grantsAndRevokes().

Hierarchy

Expanded class hierarchy of AuthorizationResponse

1 file declares its use of AuthorizationResponse
AuthorizationProfile.php in src/Entity/AuthorizationProfile.php

File

src/AuthorizationResponse.php, line 10

Namespace

Drupal\authorization
View source
class AuthorizationResponse {

  /**
   * Label of authorization message plus optional information (e.g. skipped).
   *
   * @var string
   */
  private $message;

  /**
   * Whether the profile was skipped outright.
   *
   * @var bool
   */
  private $skipped;

  /**
   * Any authorizations applied.
   *
   * @var array
   */
  private $authorizationsApplied = [];

  /**
   * AuthorizationResponse constructor.
   *
   * @param string $message
   *   Message.
   * @param bool $skipped
   *   Authorization skipped.
   * @param array $authorizations_applied
   *   Authorizations applied.
   */
  public function __construct(string $message, bool $skipped, array $authorizations_applied) {
    $this->message = $message;
    $this->skipped = $skipped;
    $this->authorizationsApplied = $authorizations_applied;
  }

  /**
   * Get the message.
   *
   * @return string
   *   The message.
   */
  public function getMessage() : string {
    return $this->message;
  }

  /**
   * If the authorization was skipped.
   *
   * @return bool
   *   If skipped.
   */
  public function getSkipped() : bool {
    return $this->skipped;
  }

  /**
   * The authorizations applied.
   *
   * @return array
   *   Authorizations.
   */
  public function getAuthorizationsApplied() : array {
    return $this->authorizationsApplied;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AuthorizationResponse::$authorizationsApplied private property Any authorizations applied.
AuthorizationResponse::$message private property Label of authorization message plus optional information (e.g. skipped).
AuthorizationResponse::$skipped private property Whether the profile was skipped outright.
AuthorizationResponse::getAuthorizationsApplied public function The authorizations applied.
AuthorizationResponse::getMessage public function Get the message.
AuthorizationResponse::getSkipped public function If the authorization was skipped.
AuthorizationResponse::__construct public function AuthorizationResponse constructor.