Public Member Functions | Protected Member Functions | Protected Attributes

Zend_Log_Writer_Mail Class Reference

Inheritance diagram for Zend_Log_Writer_Mail:
Zend_Log_Writer_Abstract

Public Member Functions

 __construct (Zend_Mail $mail, Zend_Layout $layout=null)
 getLayoutFormatter ()
 setLayoutFormatter (Zend_Log_Formatter_Interface $formatter)
 setSubjectPrependText ($subject)
 shutdown ()

Protected Member Functions

 _write ($event)
 _getFormattedNumEntriesPerPriority ()

Protected Attributes

 $_eventsToMail = array()
 $_layoutEventsToMail = array()
 $_mail
 $_layout
 $_layoutFormatter
 $_numEntriesPerPriority = array()
 $_subjectPrependText

Detailed Description

Definition at line 46 of file Mail.php.


Constructor & Destructor Documentation

__construct ( Zend_Mail mail,
Zend_Layout layout = null 
)

Class constructor.

Constructs the mail writer; requires a Zend_Mail instance, and takes an optional Zend_Layout instance. If Zend_Layout is being used, $this->_layout->events will be set for use in the layout template.

Parameters:
Zend_Mail$mailMail instance
Zend_Layout$layoutLayout instance; optional
Returns:
void

Definition at line 114 of file Mail.php.


Member Function Documentation

_getFormattedNumEntriesPerPriority (  ) [protected]

Gets a string of number of entries per-priority level that occurred, or an emptry string if none occurred.

Returns:
string

Definition at line 285 of file Mail.php.

_write ( event ) [protected]

Places event line into array of lines to be used as message body.

Handles the formatting of both plaintext entries, as well as those rendered with Zend_Layout.

Parameters:
array$eventEvent data
Returns:
void

Reimplemented from Zend_Log_Writer_Abstract.

Definition at line 130 of file Mail.php.

getLayoutFormatter (  )

Gets instance of Zend_Log_Formatter_Instance used for formatting a message using Zend_Layout, if applicable.

Returns:
Zend_Log_Formatter_Interface|null The formatter, or null.

Definition at line 163 of file Mail.php.

setLayoutFormatter ( Zend_Log_Formatter_Interface formatter )

Sets a specific formatter for use with Zend_Layout events.

Allows use of a second formatter on lines that will be rendered with Zend_Layout. In the event that Zend_Layout is not being used, this formatter cannot be set, so an exception will be thrown.

Parameters:
Zend_Log_Formatter_Interface$formatter
Returns:
Zend_Log_Writer_Mail
Exceptions:
Zend_Log_Exception

Definition at line 179 of file Mail.php.

setSubjectPrependText ( subject )

Allows caller to have the mail subject dynamically set to contain the entry counts per-priority level.

Sets the text for use in the subject, with entry counts per-priority level appended to the end. Since a Zend_Mail subject can only be set once, this method cannot be used if the Zend_Mail object already has a subject set.

Parameters:
string$subjectSubject prepend text.
Returns:
Zend_Log_Writer_Mail

Definition at line 203 of file Mail.php.

shutdown (  )

Sends mail to recipient(s) if log entries are present. Note that both plaintext and HTML portions of email are handled here.

Returns:
void

Reimplemented from Zend_Log_Writer_Abstract.

Definition at line 221 of file Mail.php.


The documentation for this class was generated from the following file: