You are here

class AcquiaContentHubUnregisterEvent in Acquia Content Hub 8.2

Event dispatched on webhook deletion.

@package Drupal\acquia_contenthub\Event

Hierarchy

Expanded class hierarchy of AcquiaContentHubUnregisterEvent

8 files declare their use of AcquiaContentHubUnregisterEvent
AcquiaContentHubSiteCommands.php in src/Commands/AcquiaContentHubSiteCommands.php
AcquiaContentHubWebhookCommands.php in src/Commands/AcquiaContentHubWebhookCommands.php
ClientDeleteConfirmForm.php in modules/acquia_contenthub_publisher/src/Form/Client/ClientDeleteConfirmForm.php
ContentHubConnectionManager.php in src/ContentHubConnectionManager.php
ContentHubDeleteClientConfirmForm.php in src/Form/ContentHubDeleteClientConfirmForm.php

... See full list

File

src/Event/AcquiaContentHubUnregisterEvent.php, line 12

Namespace

Drupal\acquia_contenthub\Event
View source
class AcquiaContentHubUnregisterEvent extends Event {

  /**
   * Uuid of the webhook.
   *
   * @var string
   *   Uuid of webhook.
   */
  protected $webhookUuid;

  /**
   * Client/origin UUID.
   *
   * @var string
   *   Client/origin UUID.
   */
  protected $originUuid;

  /**
   * Client name.
   *
   * @var string
   *   Client name.
   */
  protected $clientName;

  /**
   * Uuid of the default filter.
   *
   * @var string
   *   Uuid of default filter.
   */
  protected $defaultFilter;

  /**
   * Uuid's of orphaned filters.
   *
   * @var array
   *   Array containing the orphaned filter uuids.
   */
  protected $orphanedFilters;

  /**
   * Amount of orphaned entities.
   *
   * @var int
   *   Amount of orphaned entites.
   */
  protected $orphanedEntitiesCount;

  /**
   * Array of orphaned entities.
   *
   * @var array
   *   Array of orphaned entities.
   */
  protected $orphanedEntities;

  /**
   * Bool to decide what to delete.
   *
   * @var bool
   *   TRUE if we only want to delete the webhook.
   */
  protected $deleteWebhookOnly;

  /**
   * AcquiaContentHubUnregisterEvent constructor.
   *
   * @param string $webhook_uuid
   *   Webhook uuid.
   * @param string $client_uuid
   *   Client uuid. SHOULD BE ONLY PASSED IF WE DO AN OPERATION ON A DIFFERENT
   *   SITE, NOT ON THE CURRENT. Otherwise we get it from settings.
   * @param bool $delete_webhook_only
   *   Pass TRUE if we delete only webhook.
   */
  public function __construct(string $webhook_uuid, string $client_uuid = '', bool $delete_webhook_only = FALSE) {
    $this->webhookUuid = $webhook_uuid;
    $this->originUuid = $client_uuid;
    $this->deleteWebhookOnly = $delete_webhook_only;
  }

  /**
   * Returns webhook UUID.
   *
   * @return string
   *   Webhook UUID:
   */
  public function getWebhookUuid() : string {
    return $this->webhookUuid;
  }

  /**
   * Returns info about delete process.
   *
   * @return bool
   *   TRUE if we delete only webhook and not client.
   */
  public function isDeleteWebhookOnly() : bool {
    return $this->deleteWebhookOnly;
  }

  /**
   * Sets default filter.
   *
   * @param string $uuid
   *   Default filter UUID.
   */
  public function setDefaultFilter(string $uuid) : void {
    $this->defaultFilter = $uuid;
  }

  /**
   * Returns origin UUID.
   *
   * @return string
   *   Client/origin UUID.
   */
  public function getOriginUuid() : string {
    return $this->originUuid;
  }

  /**
   * Sets client name.
   *
   * @param string $client_name
   *   Client name.
   */
  public function setClientName(string $client_name) : void {
    $this->clientName = $client_name;
  }

  /**
   * Returns client name.
   *
   * @return string
   *   Client name.
   */
  public function getClientName() : string {
    return $this->clientName;
  }

  /**
   * Returns default filter UUID.
   *
   * @return string
   *   Default filter UUID.
   */
  public function getDefaultFilter() : string {
    return $this->defaultFilter;
  }

  /**
   * Sets orphaned filter UUIDs.
   *
   * @param array $filters
   *   Array containing orphaned filters.
   */
  public function setOrphanedFilters(array $filters) : void {
    $this->orphanedFilters = $filters;
  }

  /**
   * Returns orphaned filters UUIDs.
   *
   * @return array
   *   Array containing orphaned filters.
   */
  public function getOrphanedFilters() : array {
    return $this->orphanedFilters;
  }

  /**
   * Sets the amount of orphaned entities.
   *
   * @param int $amount
   *   Amount of orphaned entities.
   */
  public function setOrphanedEntitiesAmount(int $amount) : void {
    $this->orphanedEntitiesCount = $amount;
  }

  /**
   * Returns the amount of orphaned entities.
   *
   * @return int
   *   Amount of orphaned entities.
   */
  public function getOrphanedEntitiesAmount() : int {
    return $this->orphanedEntitiesCount;
  }

  /**
   * Sets the array of orphaned entities.
   *
   * @param array $entities
   *   Array of orphaned entities.
   */
  public function setOrphanedEntities(array $entities) : void {
    $this->orphanedEntities = $entities;
  }

  /**
   * Returns the orphaned entities.
   *
   * @return array
   *   Array of orphaned entities.
   */
  public function getOrphanedEntities() : array {
    return $this->orphanedEntities;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AcquiaContentHubUnregisterEvent::$clientName protected property Client name.
AcquiaContentHubUnregisterEvent::$defaultFilter protected property Uuid of the default filter.
AcquiaContentHubUnregisterEvent::$deleteWebhookOnly protected property Bool to decide what to delete.
AcquiaContentHubUnregisterEvent::$originUuid protected property Client/origin UUID.
AcquiaContentHubUnregisterEvent::$orphanedEntities protected property Array of orphaned entities.
AcquiaContentHubUnregisterEvent::$orphanedEntitiesCount protected property Amount of orphaned entities.
AcquiaContentHubUnregisterEvent::$orphanedFilters protected property Uuid's of orphaned filters.
AcquiaContentHubUnregisterEvent::$webhookUuid protected property Uuid of the webhook.
AcquiaContentHubUnregisterEvent::getClientName public function Returns client name.
AcquiaContentHubUnregisterEvent::getDefaultFilter public function Returns default filter UUID.
AcquiaContentHubUnregisterEvent::getOriginUuid public function Returns origin UUID.
AcquiaContentHubUnregisterEvent::getOrphanedEntities public function Returns the orphaned entities.
AcquiaContentHubUnregisterEvent::getOrphanedEntitiesAmount public function Returns the amount of orphaned entities.
AcquiaContentHubUnregisterEvent::getOrphanedFilters public function Returns orphaned filters UUIDs.
AcquiaContentHubUnregisterEvent::getWebhookUuid public function Returns webhook UUID.
AcquiaContentHubUnregisterEvent::isDeleteWebhookOnly public function Returns info about delete process.
AcquiaContentHubUnregisterEvent::setClientName public function Sets client name.
AcquiaContentHubUnregisterEvent::setDefaultFilter public function Sets default filter.
AcquiaContentHubUnregisterEvent::setOrphanedEntities public function Sets the array of orphaned entities.
AcquiaContentHubUnregisterEvent::setOrphanedEntitiesAmount public function Sets the amount of orphaned entities.
AcquiaContentHubUnregisterEvent::setOrphanedFilters public function Sets orphaned filter UUIDs.
AcquiaContentHubUnregisterEvent::__construct public function AcquiaContentHubUnregisterEvent constructor.