HookResubscribe.php 725 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * Class HookResubscribe
  5. * @var \SplObjectStorage $observers
  6. */
  7. class HookResubscribe extends HookEvent implements HookResubscribeEventInterface
  8. {
  9. /**
  10. * Constructor
  11. */
  12. protected function __construct()
  13. {
  14. parent::__construct('HookResubscribe');
  15. }
  16. /**
  17. * Update all the observers
  18. * @param int $type
  19. *
  20. * @return int
  21. */
  22. public function notifyResubscribe($type)
  23. {
  24. /** @var \HookResubscribeObserverInterface $observer */
  25. $this->eventData['type'] = $type;
  26. foreach ($this->observers as $observer) {
  27. $observer->hookResubscribe($this);
  28. }
  29. return 1;
  30. }
  31. }