Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
Public Member Functions | Public Attributes | List of all members
NotificationManager Class Reference

Public Member Functions

 setNotificators ($config)
 getNotificators ()
 addNotificator ($name, $notificatorConfig)
 removeNotificator ($name)
 init ()
 notifyAbout (Notification $notification)

Public Attributes

 $cacheTime

Detailed Description

Gentics Portal.Node PHP Author & Copyright (c) by Gentics Software GmbH sales.nosp@m.@gen.nosp@m.tics..nosp@m.com http://www.gentics.com Licenses can be found in the LICENSE.txt file in the root-folder of this installation You must not use this software without a valid license agreement.

Component for handling all Notifications in system. If need to notify all Notificators about event invoked method Yii::app()->notificationManager->notifyAbout($notification);

Definition at line 13 of file NotificationManager.php.

Member Function Documentation

NotificationManager::addNotificator (   $name,
  $notificatorConfig 
)

Add notificator

Parameters
string$namenotificator name, if exists will be replaced
array | object$notificatorConfignotificator config array or object
Returns
void

Definition at line 55 of file NotificationManager.php.

Referenced by init().

{
if (is_array($notificatorConfig)) {
$notificatorConfig = Yii::createComponent($notificatorConfig);
$notificatorConfig->init();
$this->_notificators[$name] = $notificatorConfig;
} elseif ($notificatorConfig instanceof CComponent) {
$this->_notificators[$name] = $notificatorConfig;
}
}
NotificationManager::getNotificators ( )

Public getter

Returns
array

Definition at line 42 of file NotificationManager.php.

{
return $this->_notificators;
}
NotificationManager::init ( )

Init manager

Returns
void

Definition at line 83 of file NotificationManager.php.

References addNotificator().

{
foreach ($this->_notificators as $name => $notificator) {
$this->addNotificator($name, $notificator);
}
}
NotificationManager::notifyAbout ( Notification  $notification)

Method which starts handle $notification by all notificators

Parameters
Notification$notificationoccurred notification
Returns
void

Definition at line 98 of file NotificationManager.php.

{
foreach ($this->_notificators as $notificator) {
$notificator->notify($notification);
}
}
NotificationManager::removeNotificator (   $name)

Remove notificator

Parameters
string$namenotificator name
Returns
void

Definition at line 73 of file NotificationManager.php.

{
unset($this->_notificators[$name]);
}
NotificationManager::setNotificators (   $config)

Public setter

Parameters
array$configconfiguration array
Returns
void

Definition at line 30 of file NotificationManager.php.

{
foreach ($config as $name => $notificator) {
$this->_notificators[$name] = $notificator;
}
}

The documentation for this class was generated from the following file: