Issues (752)

includes/notifiers/class.newtodotasknotifier.php (1 issue)

1
<?php
2
3
/**
4
 * NewTodoTaskNotifier.
5
 *
6
 * Generates notifications update To-Do list folder.
7
 */
8
class NewTodoTaskNotifier extends Notifier {
9
	/**
10
	 * @return Number the event which this module handles
11
	 */
12
	#[Override]
13
	public function getEvents() {
14
		return OBJECT_SAVE;
15
	}
16
17
	/**
18
	 * If an event elsewhere has occurred, it enters in this method. This method
19
	 * executes one or more actions, depends on the event.
20
	 *
21
	 * @param int    $event   event
22
	 * @param string $entryid entryid
23
	 * @param mixed  $props
24
	 */
25
	#[Override]
26
	public function update($event, $entryid, $props) {
27
		switch ($event) {
28
			case OBJECT_SAVE:
29
				$data['item'][] = [
0 ignored issues
show
Comprehensibility Best Practice introduced by
$data was never initialized. Although not strictly required by PHP, it is generally a good practice to add $data = array(); before regardless.
Loading history...
30
					'entryid' => $entryid,
31
					'store_entryid' => bin2hex((string) $props[PR_STORE_ENTRYID]),
32
				];
33
				$this->addNotificationActionData("newtodotask", $data);
34
				$GLOBALS["bus"]->addData($this->createNotificationResponseData());
35
				break;
36
		}
37
	}
38
}
39