ZenMagick 0.9.8


org.zenmagick.mvc.services.misc.ZMMessages
\mvc\services\misc\ZMMessages.php at line 41

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 2762 2009-12-18 02:51:36Z dermanomann $

Field Summary
final str

REF_GLOBAL

Catch all (global) message reference type.

final str

T_ERROR

Message type error.

final str

T_MESSAGE

Message type message.

final str

T_SUCCESS

Message type success.

final str

T_WARN

Message type warn.

Fields inherited from org.zenmagick.core.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

clear()

Clear all messages.

void

error(string text, string ref)

Add an error message.

array

getMessages(string ref, boolean clear)

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.core.ZMObject
attachMethod, get, getAttachedMethods, getPropertyNames, set, singleton

Field Detail

\mvc\services\misc\ZMMessages.php at line 43

REF_GLOBAL

public final str REF_GLOBAL = 'global'

Catch all (global) message reference type.


\mvc\services\misc\ZMMessages.php at line 51

T_ERROR

public final str T_ERROR = 'error'

Message type error.


\mvc\services\misc\ZMMessages.php at line 47

T_MESSAGE

public final str T_MESSAGE = 'msg'

Message type message.


\mvc\services\misc\ZMMessages.php at line 45

T_SUCCESS

public final str T_SUCCESS = 'success'

Message type success.


\mvc\services\misc\ZMMessages.php at line 49

T_WARN

public final str T_WARN = 'warn'

Message type warn.


Constructor Detail

\mvc\services\misc\ZMMessages.php at line 60

ZMMessages

public ZMMessages()

Create new instance.


Method Detail

\mvc\services\misc\ZMMessages.php at line 87

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::REF_GLOBAL.

\mvc\services\misc\ZMMessages.php at line 140

addAll

public void addAll(array messages)

Add a group of messages.

Parameters:
messages - List of ZMMessage instances.

\mvc\services\misc\ZMMessages.php at line 169

clear

public void clear()

Clear all messages.


\mvc\services\misc\ZMMessages.php at line 101

error

public void error(string text, string ref)

Add an error message.

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

\mvc\services\misc\ZMMessages.php at line 181

getMessages

public array getMessages(string ref, boolean clear)

Get all messages.

Parameters:
ref - The referring resource; default is null for all.
Parameters:
clear - Optional flag to clear the internal buffer; default is false.
Returns:
List of ZMMessage instances.

\mvc\services\misc\ZMMessages.php at line 152

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.

\mvc\services\misc\ZMMessages.php at line 75

instance

public static void instance()

Get instance.


\mvc\services\misc\ZMMessages.php at line 121

msg

public void msg(string text, string ref)

Add a default message.

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

\mvc\services\misc\ZMMessages.php at line 131

success

public void success(string text, string ref)

Add a success message.

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

\mvc\services\misc\ZMMessages.php at line 111

warn

public void warn(string text, string ref)

Add a warning message.

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

ZenMagick 0.9.8