You are here

class RoleExpiresEvent in Role Expire 8

Same name and namespace in other branches
  1. 2.x src/Event/RoleExpiresEvent.php \Drupal\role_expire\Event\RoleExpiresEvent

Event that is fired when a user loses one of its roles.

Hierarchy

  • class \Drupal\role_expire\Event\RoleExpiresEvent extends \Symfony\Component\EventDispatcher\Event

Expanded class hierarchy of RoleExpiresEvent

See also

role_expire_cron()

1 file declares its use of RoleExpiresEvent
role_expire.module in ./role_expire.module
Role Expire module.

File

src/Event/RoleExpiresEvent.php, line 13

Namespace

Drupal\role_expire\Event
View source
class RoleExpiresEvent extends Event {
  const EVENT_NAME = 'role_expire_event_role_expires';

  /**
   * The user account.
   *
   * @var \Drupal\user\UserInterface
   */
  public $account;

  /**
   * The rid of the role which the user has lost.
   *
   * @var string
   */
  public $ridBefore;

  /**
   * Constructs the object.
   *
   * @param \Drupal\user\UserInterface $account
   *   The account of the user logged in.
   * @param string $ridBefore
   *   The role name that has expired.
   */
  public function __construct(UserInterface $account, $ridBefore) {
    $this->account = $account;
    $this->ridBefore = $ridBefore;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
RoleExpiresEvent::$account public property The user account.
RoleExpiresEvent::$ridBefore public property The rid of the role which the user has lost.
RoleExpiresEvent::EVENT_NAME constant
RoleExpiresEvent::__construct public function Constructs the object.