ZenMagick 0.9.6


org.zenmagick.service.ZMMessages

Class ZMMessages

ZMObject
|
+--ZMMessages

public class ZMMessages
extends ZMObject

Messages to be displayed to the user.

Messages will be saved in the session if not delivered.

Code supported message levels are:

Author:
DerManoMann
Version:
$Id: ZMMessages.php 2240 2009-05-27 03:53:12Z DerManoMann $

Field Summary
final mixed

T_ERROR

final mixed

T_GLOBAL

final mixed

T_MESSAGE

final mixed

T_SUCCESS

final mixed

T_WARN

Fields inherited from org.zenmagick.ZMObject
properties_
Constructor Summary

ZMMessages()

Create new instance.

Method Summary
void

add(string text, string type, string ref)

Generic add a message.

void

addAll(array messages)

Add a group of messages.

void

error(string text, string ref)

Add an error message.

array

getMessages(string ref)

Get all messages.

boolean

hasMessages(string ref)

Checks if there are any messages available.

static void

instance()

Get instance.

void

msg(string text, string ref)

Add a default message.

void

success(string text, string ref)

Add a success message.

void

warn(string text, string ref)

Add a warning message.

Methods inherited from org.zenmagick.ZMObject
attachMethod, get, getAttachedMethods, getPropertyNames, set, singleton

Field Detail

T_ERROR

public final mixed T_ERROR = 'error'

T_GLOBAL

public final mixed T_GLOBAL = 'global'

T_MESSAGE

public final mixed T_MESSAGE = 'msg'

T_SUCCESS

public final mixed T_SUCCESS = 'success'

T_WARN

public final mixed T_WARN = 'warn'

Constructor Detail

ZMMessages

public ZMMessages()

Create new instance. /


Method Detail

add

public void add(string text, string type, string ref)

Generic add a message.

Parameters:
text - The message text.
type - The message type; default is ZMMessages::T_MESSAGE.
ref - The referencing resource; default is ZMMessages::T_GLOBAL.

addAll

public void addAll(array messages)

Add a group of messages.

Parameters:
messages - List of ZMMessage instances.

error

public void error(string text, string ref)

Add an error message.

Parameters:
text - The message text.
ref - The referencing resource; default is ZMMessages::T_GLOBAL.

getMessages

public array getMessages(string ref)

Get all messages.

Parameters:
ref - The referring resource; default is null for all.
Returns:
List of ZMMessage instances.

hasMessages

public boolean hasMessages(string ref)

Checks if there are any messages available.

Parameters:
ref - The referencing resource; default is null for all.
Returns:
true if messages are available, false if not.

instance

public static void instance()

Get instance. /


msg

public void msg(string text, string ref)

Add a default message.

Parameters:
text - The message text.
ref - The referencing resource; default is ZMMessages::T_GLOBAL.

success

public void success(string text, string ref)

Add a success message.

Parameters:
text - The message text.
ref - The referencing resource; default is ZMMessages::T_GLOBAL.

warn

public void warn(string text, string ref)

Add a warning message.

Parameters:
text - The message text.
ref - The referencing resource; default is ZMMessages::T_GLOBAL.

ZenMagick 0.9.6