HookCreateCourse.php 755 B

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