UserEvent.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /**
  3. * @link http://www.yiiframework.com/
  4. * @copyright Copyright (c) 2008 Yii Software LLC
  5. * @license http://www.yiiframework.com/license/
  6. */
  7. namespace yii\web;
  8. use yii\base\Event;
  9. /**
  10. * This event class is used for Events triggered by the [[User]] class.
  11. *
  12. * @author Qiang Xue <qiang.xue@gmail.com>
  13. * @since 2.0
  14. */
  15. class UserEvent extends Event
  16. {
  17. /**
  18. * @var IdentityInterface the identity object associated with this event
  19. */
  20. public $identity;
  21. /**
  22. * @var bool whether the login is cookie-based. This property is only meaningful
  23. * for [[User::EVENT_BEFORE_LOGIN]] and [[User::EVENT_AFTER_LOGIN]] events.
  24. */
  25. public $cookieBased;
  26. /**
  27. * @var int number of seconds that the user can remain in logged-in status.
  28. * If 0, it means login till the user closes the browser or the session is manually destroyed.
  29. */
  30. public $duration;
  31. /**
  32. * @var bool whether the login or logout should proceed.
  33. * Event handlers may modify this property to determine whether the login or logout should proceed.
  34. * This property is only meaningful for [[User::EVENT_BEFORE_LOGIN]] and [[User::EVENT_BEFORE_LOGOUT]] events.
  35. */
  36. public $isValid = true;
  37. }