1 | <?php |
||
15 | class IncidentSiren implements \SplObserver |
||
16 | { |
||
17 | const FILE_NAME_ALARM_TRIGGER = 'alarm_triger.data'; |
||
18 | |||
19 | /** |
||
20 | * @var NotificationTypeInterface |
||
21 | */ |
||
22 | protected $notificationTypeI; |
||
23 | |||
24 | /** |
||
25 | * email or tel numbers |
||
26 | * |
||
27 | * @var SubjectCollection |
||
28 | */ |
||
29 | protected $subjects; |
||
30 | |||
31 | |||
32 | /** |
||
33 | * IncidentSiren constructor. |
||
34 | * @param NotificationTypeInterface $notificationTypeI |
||
35 | * @param null|SubjectCollection $subjects |
||
36 | * @throws IncidentSirenException |
||
37 | */ |
||
38 | public function __construct(NotificationTypeInterface $notificationTypeI, SubjectCollection $subjects = null) |
||
46 | |||
47 | /** |
||
48 | * Receive update from subject |
||
49 | * @link http://php.net/manual/en/splobserver.update.php |
||
50 | * @param SplSubject $subject <p> |
||
51 | * The <b>SplSubject</b> notifying the observer of an update. |
||
52 | * </p> |
||
53 | * @return void |
||
54 | * @since 5.1.0 |
||
55 | */ |
||
56 | public function update(SplSubject $subject) |
||
64 | |||
65 | /** |
||
66 | * @param IncidentInterface $incident |
||
67 | * @param null|array $subjects |
||
68 | */ |
||
69 | public function notify(IncidentInterface $incident, $subjects = null) |
||
81 | |||
82 | /** |
||
83 | * @return NotificationTypeInterface |
||
84 | */ |
||
85 | public function getNotificationTypeI() |
||
89 | |||
90 | /** |
||
91 | * @return SubjectCollection |
||
92 | */ |
||
93 | public function getSubjects() |
||
97 | |||
98 | /** |
||
99 | * @param SubjectCollection $subjects |
||
100 | */ |
||
101 | protected function setSubjects(SubjectCollection $subjects) |
||
105 | |||
106 | /** |
||
107 | * @param NotificationTypeInterface $notificationTypeI |
||
108 | */ |
||
109 | protected function setNotificationTypeI(NotificationTypeInterface $notificationTypeI) |
||
113 | |||
114 | /** |
||
115 | * @param IncidentInterface $incident |
||
116 | * @param $subject |
||
117 | */ |
||
118 | protected function notifySubject(IncidentInterface $incident, $subject) |
||
124 | |||
125 | } |
||
126 |