7
* This source file is subject to the new BSD license that is bundled
8
* with this package in the file LICENSE.txt.
9
* It is also available through the world-wide-web at this URL:
10
* http://framework.zend.com/license/new-bsd
11
* If you did not receive a copy of the license and are unable to
12
* obtain it through the world-wide-web, please send an email
13
* to license@zend.com so we can send you a copy immediately.
16
* @package Zend_Wildfire
18
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
19
* @license http://framework.zend.com/license/new-bsd New BSD License
24
* A message envelope that can be passed to Zend_Wildfire_Plugin_FirePhp to be
25
* logged to Firebug instead of a variable.
28
* @package Zend_Wildfire
30
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
31
* @license http://framework.zend.com/license/new-bsd New BSD License
33
class Zend_Wildfire_Plugin_FirePhp_Message
36
* The style of the message
39
protected $_style = null;
42
* The label of the message
45
protected $_label = null;
51
protected $_message = null;
54
* Flag indicating if message buffering is enabled
57
protected $_buffered = false;
60
* Flag indicating if message should be destroyed and not delivered
63
protected $_destroy = false;
66
* Random unique ID used to identify message in comparison operations
69
protected $_ruid = false;
72
* Creates a new message with the given style and message
74
* @param string $style Style of the message.
75
* @param mixed $message The message
78
function __construct($style, $message)
80
$this->_style = $style;
81
$this->_message = $message;
82
$this->_ruid = md5(microtime().mt_rand());
86
* Set the label of the message
88
* @param string $label The label to be set
91
public function setLabel($label)
93
$this->_label = $label;
97
* Get the label of the message
99
* @return string The label of the message
101
public function getLabel()
103
return $this->_label;
107
* Enable or disable message buffering
109
* If a message is buffered it can be updated for the duration of the
110
* request and is only flushed at the end of the request.
112
* @param boolean $buffered TRUE to enable buffering FALSE otherwise
113
* @return boolean Returns previous buffering value
115
public function setBuffered($buffered)
117
$previous = $this->_buffered;
118
$this->_buffered = $buffered;
123
* Determine if buffering is enabled or disabled
125
* @return boolean Returns TRUE if buffering is enabled, FALSE otherwise.
127
public function getBuffered()
129
return $this->_buffered;
133
* Destroy the message to prevent delivery
135
* @param boolean $destroy TRUE to destroy FALSE otherwise
136
* @return boolean Returns previous destroy value
138
public function setDestroy($destroy)
140
$previous = $this->_destroy;
141
$this->_destroy = $destroy;
146
* Determine if message should be destroyed
148
* @return boolean Returns TRUE if message should be destroyed, FALSE otherwise.
150
public function getDestroy()
152
return $this->_destroy;
156
* Set the style of the message
160
public function setStyle($style)
162
$this->_style = $style;
166
* Get the style of the message
168
* @return string The style of the message
170
public function getStyle()
172
return $this->_style;
176
* Set the actual message to be sent in its final format.
180
public function setMessage($message)
182
$this->_message = $message;
186
* Get the actual message to be sent in its final format.
188
* @return mixed Returns the message to be sent.
190
public function getMessage()
192
return $this->_message;