You are here

UserCancelEvent.php in Hook Event Dispatcher 8

File

src/Event/User/UserCancelEvent.php
View source
<?php

namespace Drupal\hook_event_dispatcher\Event\User;

use Drupal\Core\Session\AccountInterface;
use Drupal\hook_event_dispatcher\Event\EventInterface;
use Drupal\hook_event_dispatcher\HookEventDispatcherInterface;
use Symfony\Component\EventDispatcher\Event;

/**
 * Class UserCancelEvent.
 */
final class UserCancelEvent extends Event implements EventInterface {

  /**
   * The array of form values submitted by the user.
   *
   * @var array
   */
  private $edit;

  /**
   * Account.
   *
   * @var \Drupal\Core\Session\AccountInterface
   */
  private $account;

  /**
   * The account cancellation method.
   *
   * @var string
   */
  private $method;

  /**
   * UserCancelEvent constructor.
   *
   * @param array $edit
   *   The array of form values submitted by the user.
   * @param \Drupal\Core\Session\AccountInterface $account
   *   Account.
   * @param string $method
   *   The account cancellation method.
   */
  public function __construct(array $edit, AccountInterface $account, $method) {
    $this->edit = $edit;
    $this->account = $account;
    $this->method = $method;
  }

  /**
   * Get edit array.
   *
   * @return array
   *   The array of form values submitted by the user.
   */
  public function getEdit() {
    return $this->edit;
  }

  /**
   * Get the account.
   *
   * @return \Drupal\Core\Session\AccountInterface
   *   Account.
   */
  public function getAccount() {
    return $this->account;
  }

  /**
   * Get method.
   *
   * @return string
   *   The account cancellation method.
   */
  public function getMethod() {
    return $this->method;
  }

  /**
   * Get the dispatcher type.
   *
   * @return string
   *   The dispatcher type.
   */
  public function getDispatcherType() {
    return HookEventDispatcherInterface::USER_CANCEL;
  }

}

Classes

Namesort descending Description
UserCancelEvent Class UserCancelEvent.