ZenMagick 0.9.10


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

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

Constant Summary
final static str

REF_GLOBAL

Catch all (global) message reference type.

final static str

T_ERROR

Message type error.

final static str

T_MESSAGE

Message type message.

final static str

T_SUCCESS

Message type success.

final static str

T_WARN

Message type warn.

Fields inherited from org.zenmagick.core\ZMObject
properties_
Method Summary
void

__construct()

Create new instance.

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

loadMessages(ZMSession session)

Load messages from session.

void

msg(string text, string ref)

Add a default message.

void

saveMessages(ZMSession session)

Save messages in session.

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
__construct, attachMethod, get, getAttachedMethods, getProperties, getPropertyNames, set, singleton

Constant Detail

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

REF_GLOBAL

public final static str REF_GLOBAL = 'global'

Catch all (global) message reference type.


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

T_ERROR

public final static str T_ERROR = 'error'

Message type error.


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

T_MESSAGE

public final static str T_MESSAGE = 'msg'

Message type message.


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

T_SUCCESS

public final static str T_SUCCESS = 'success'

Message type success.


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

T_WARN

public final static str T_WARN = 'warn'

Message type warn.


Method Detail

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

__construct

public void __construct()

Create new instance.


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

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 139

addAll

public void addAll(array messages)

Add a group of messages.

Parameters:
messages - List of ZMMessage instances.

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

clear

public void clear()

Clear all messages.


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

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 180

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 151

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 74

instance

public static void instance()

Get instance.


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

loadMessages

public void loadMessages(ZMSession session)

Load messages from session.

Parameters:
session - The current session.

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

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 204

saveMessages

public void saveMessages(ZMSession session)

Save messages in session.

Parameters:
session - The current session.

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

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 110

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.10