\Folks_Notification_mail

Folks Notification Class.

Copyright Obala d.o.o. (www.obala.si)

See the enclosed file LICENSE for license information (GPL). If you did not receive this file, see http://www.horde.org/licenses/gpl.

Summary

Methods
Properties
Constants
__construct()
notifyAll()
notifyAllFriends()
notifyAdmins()
getAdmins()
getMethods()
singleton()
getName()
isAvailable()
notify()
notifyFriends()
No public properties found
No constants found
_getUserFromAddr()
factory()
$_params
N/A
No private methods found
$instances
N/A

Properties

$_params

$_params : 

Driver parameters

Type

$instances

$instances : 

Instances

Type

Methods

__construct()

__construct(array  $params = array()) 

Constructor

Parameters

array $params

A hash containing any additional configuration or connection parameters a subclass might need.

notifyAll()

notifyAll(string  $subject, string  $body, array  $attachments = array(), mixed  $user = null) : true

Notify user in all available drivers

Parameters

string $subject

Subject of message

string $body

Body of message

array $attachments

Attached files

mixed $user

User or array of users to send notification to

Returns

true —

on succes, PEAR_Error on failure

notifyAllFriends()

notifyAllFriends(string  $subject, string  $body, array  $attachments = array(), string  $user = null) : true

Notify user's friends in all available drivers

Parameters

string $subject

Subject of message

string $body

Body of message

array $attachments

Attached files

string $user

User to send notifications to

Returns

true —

on succes, PEAR_Error on failure

notifyAdmins()

notifyAdmins(string  $subject, string  $body, array  $attachments = array()) : true

Notify user in all available drivers

Parameters

string $subject

Subject of message

string $body

Body of message

array $attachments

Attached files

Returns

true —

on succes, PEAR_Error on failure

getAdmins()

getAdmins() : Array

Get current scope admins

Returns

Array —

of user with delete permission in "scope:admin" permission

getMethods()

getMethods(string  $type = 'user') : true

Returns all avaiable methods

Parameters

string $type

Type of notification to check

Returns

true —

on succes, PEAR_Error on failure

singleton()

singleton(string  $driver, array  $params = null) 

Singleton for driver object

Parameters

string $driver

The type of the concrete Folks_Notification subclass to return. The class name is based on the storage Notification ($driver). The code is dynamically included.

array $params

A hash containing any additional configuration or connection parameters a subclass might need.

getName()

getName() 

Returns method human name

isAvailable()

isAvailable(string  $type) : boolean

Checks if a driver is available for a certain notification type

Parameters

string $type

Notification type

Returns

boolean

notify()

notify(mixed  $user, string  $subject, string  $body, array  $attachments = array()) : true

Notify user

Parameters

mixed $user

User or array of users to send notification to

string $subject

Subject of message

string $body

Body of message

array $attachments

Attached files

Returns

true —

on succes, PEAR_Error on failure

notifyFriends()

notifyFriends(mixed  $user, string  $subject, string  $body, array  $attachments = array()) : true

Notify user's friends

Parameters

mixed $user

User or array of users to send notification to

string $subject

Subject of message

string $body

Body of message

array $attachments

Attached files

Returns

true —

on succes, PEAR_Error on failure

_getUserFromAddr()

_getUserFromAddr(string  $user) : string

Try to get read user from address

Parameters

string $user

Username

Returns

string —

User email

factory()

factory(string  $driver, array  $params = null) : \Folks_Notification

Attempts to return a concrete Folks_Notification instance based on $driver.

Parameters

string $driver

The type of the concrete Folks_Notification subclass to return. The class name is based on the storage driver ($driver). The code is dynamically included.

array $params

A hash containing any additional configuration or connection parameters a subclass might need.

Returns

\Folks_Notification

The newly created concrete Folks_Notification instance, or false on an error.