You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.2 KiB
47 lines
1.2 KiB
<?php
|
|
/* For licensing terms, see /license.txt */
|
|
|
|
/**
|
|
* Class HookNotificationContent
|
|
* Hook Event class for Content format of Notifications
|
|
* @package chamilo.library.hook
|
|
*
|
|
*/
|
|
class HookNotificationContent extends HookEvent implements HookNotificationContentEventInterface
|
|
{
|
|
/**
|
|
* Construct
|
|
*/
|
|
protected function __construct()
|
|
{
|
|
parent::__construct('HookNotificationContent');
|
|
}
|
|
|
|
/**
|
|
* @param int $type
|
|
*
|
|
* @return array|null
|
|
*/
|
|
public function notifyNotificationContent($type)
|
|
{
|
|
/** @var \HookNotificationContentObserverInterface $observer */
|
|
// Check if exists data content
|
|
if (isset($this->eventData['content'])) {
|
|
// Save data type
|
|
$this->eventData['type'] = $type;
|
|
// Check for hook all registered observers
|
|
foreach ($this->observers as $observer) {
|
|
$data = $observer->hookNotificationContent($this);
|
|
// Check if isset content
|
|
if (isset($data['content'])) {
|
|
// Set data from hook observer data
|
|
$this->setEventData($data);
|
|
}
|
|
}
|
|
|
|
return $this->eventData;
|
|
}
|
|
|
|
return null;
|
|
}
|
|
}
|
|
|