A user level alert

Alerts are intended to be displayed in the product as quick notifications generated on the fly for WHMCS users. Clients will be able to view alerts in the client area from the notification widget in the top right corner.

class Alert

Properties summary

Type Property Description
protected $message An alert's message.
protected $severity An alert's severity.
$link An optional link target to provide along with an alert.
protected $linkText An optional link text to provide along with an alert.

Methods summary

Return Type Method Name Description
__construct(string $message, string $severity = 'info', string $link = null, string $linkText = null) Build a new user alert.
string getMessage() Retrieve an alert's message.
Alert setMessage(string $message) Set an alert's message.
string getSeverity() Retrieve an alert's severity.
Alert setSeverity(string $severity = 'info') Set an alert's severity.
string getLink() Retrieve an optional link target to provide along with an alert.
Alert setLink(string $link) Set an optional link target to provide along with an alert.
string getLinkText() Retrieve an optional link text to provide along with an alert.
Alert setLinkText(string $linkText) Set an optional link text to provide along with an alert.

Details

__construct (string $message, string $severity = 'info', string $link = null, string $linkText = null)

Build a new user alert.

Parameters

string $message
string $severity
string $link
string $linkText

string getMessage ()

Retrieve an alert's message.

Return Value

string

protected Alert setMessage (string $message)

Set an alert's message.

Parameters

string $message

Return Value

Alert

string getSeverity ()

Retrieve an alert's severity.

Return Value

string

protected Alert setSeverity (string $severity = 'info')

Set an alert's severity.

Parameters

string $severity

Return Value

Alert

Exceptions

Exception if $severity is not a Bootstrap alert level.

Retrieve an optional link target to provide along with an alert.

Return Value

string

Set an optional link target to provide along with an alert.

Parameters

string $link

Return Value

Alert

string getLinkText ()

Retrieve an optional link text to provide along with an alert.

Return Value

string

protected Alert setLinkText (string $linkText)

Set an optional link text to provide along with an alert.

Parameters

string $linkText

Return Value

Alert