\org_openpsa_notifications

Class for notifying users of different events. Usage is reasonably straightforward:

// Populate the message $message = [];

// Add content for long notification formats (email and RSS) $message['title'] = 'Something has happened'; $message['content'] = 'Somebody did something...';

// Add content for short notification formats (XMPP, SMS, Growl) $message['abstract'] = 'Somebody did something';

// Send it org_openpsa_notifications::notify('net.example.component:some_action', $recipient_guid, $message);

If you want users to take some action related to the message, it is a good idea to include URLs in the message.

Summary

Methods
Properties
Constants
__construct()
__get()
__isset()
set_active_leaf()
add_stylesheet()
get_workflow()
notify()
load_datamanager()
$_component
$_i18n
$_l10n
$_l10n_midcom
$_config
No constants found
No protected methods found
No protected properties found
N/A
_merge_notification_prefences()
_list_notifiers()
$_services
N/A

Properties

$_component

$_component : string

The name of the component, e.g. net.nehmer.static. Should be used whenever the component's name is required instead of hardcoding it.

Type

string

$_i18n

$_i18n : \midcom_services_i18n

A handle to the i18n service.

Type

\midcom_services_i18n

$_l10n

$_l10n : \midcom_services_i18n_l10n

The components' L10n string database.

Type

\midcom_services_i18n_l10n

$_l10n_midcom

$_l10n_midcom : \midcom_services_i18n_l10n

The global MidCOM string database.

Type

\midcom_services_i18n_l10n

$_config

$_config : \midcom_helper_configuration

The current configuration.

Type

\midcom_helper_configuration

$_services

$_services : array

Array that holds the already instantiated services

Type

array

Methods

__construct()

__construct() 

Initialize all member variables, remember to set $_component before calling this constructor from your derived classes.

__get()

__get(  $field) 

Parameters

$field

__isset()

__isset(  $field) 

Parameters

$field

set_active_leaf()

set_active_leaf(  $leaf_id) 

Parameters

$leaf_id

add_stylesheet()

add_stylesheet(string  $url, string  $media = false) 

Convenience shortcut for adding CSS files

Parameters

string $url

The stylesheet URL

string $media

The media type(s) for the stylesheet, if any

get_workflow()

get_workflow(string  $identifier, array  $options = array()) : \midcom\workflow\dialog

Parameters

string $identifier
array $options

Returns

\midcom\workflow\dialog

notify()

notify(string  $component_action, string  $recipient, array  $message) 

Sends a notice to a selected person

Parameters

string $component_action

Key of the event in format component:event

string $recipient

GUID of the receiving person

array $message

Notification message in array format

load_datamanager()

load_datamanager() 

_merge_notification_prefences()

_merge_notification_prefences(string  $component, string  $action, \midcom_db_person  $recipient) : Array

Find out how a person prefers to get the event notification

Parameters

string $component

Component name

string $action

Event name

\midcom_db_person $recipient

The receiving person

Returns

Array —

options supported by user

_list_notifiers()

_list_notifiers()