Passed
Push — master ( 6f8cb0...cccadf )
by Julito
09:47
created

HookMyStudentsLpTracking::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

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