HookMyStudentsLpTracking.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * Class HookMyStudentsLpTracking.
  5. */
  6. class HookMyStudentsLpTracking extends HookEvent implements HookMyStudentsLpTrackingEventInterface
  7. {
  8. /**
  9. * HookMyStudentsLpTracking constructor.
  10. *
  11. * @throws Exception
  12. */
  13. protected function __construct()
  14. {
  15. parent::__construct('HookMyStudentsLpTracking');
  16. }
  17. /**
  18. * @return array
  19. */
  20. public function notifyTrackingHeader()
  21. {
  22. $results = [];
  23. /** @var HookMyStudentsLpTrackingObserverInterface $observer */
  24. foreach ($this->observers as $observer) {
  25. $results[] = $observer->trackingHeader($this);
  26. }
  27. return $results;
  28. }
  29. /**
  30. * @param int $lpId
  31. * @param int $studentId
  32. *
  33. * @return array
  34. */
  35. public function notifyTrackingContent($lpId, $studentId)
  36. {
  37. $this->eventData['lp_id'] = $lpId;
  38. $this->eventData['student_id'] = $studentId;
  39. $results = [];
  40. /** @var HookMyStudentsLpTrackingObserverInterface $observer */
  41. foreach ($this->observers as $observer) {
  42. $results[] = $observer->trackingContent($this);
  43. }
  44. return $results;
  45. }
  46. }