Public Member Functions | Protected Member Functions | Protected Attributes

Robo47_Mail_Transport_Multi Class Reference

List of all members.

Public Member Functions

 __construct ($transports=array())
 addTransport (Zend_Mail_Transport_Abstract $transport)
 Add Transport.
 getTransports ()
 Get Transports.
 removeTransport ($class)
 Remove Transport.
 send (Zend_Mail $mail)
 Send a mail using this transport.
 setTransports ($transports)
 Set Transports.

Protected Member Functions

 _sendMail ()
 Not Really needed ...

Protected Attributes

 $_transports = array()

Detailed Description

Definition at line 31 of file Multi.php.


Constructor & Destructor Documentation

Robo47_Mail_Transport_Multi::__construct ( transports = array()  ) 
Parameters:
array|Zend_Mail_Transport_Abstract $transports

Definition at line 44 of file Multi.php.

References setTransports().

    {
        $this->setTransports($transports);
    }

Here is the call graph for this function:


Member Function Documentation

Robo47_Mail_Transport_Multi::_sendMail (  )  [protected]

Not Really needed ...

empty just to fullfil the requirements of the parent class

Definition at line 131 of file Multi.php.

    {
        
    }

Robo47_Mail_Transport_Multi::addTransport ( Zend_Mail_Transport_Abstract $  transport  ) 

Add Transport.

Parameters:
Zend_Mail_Transport_Abstract $transport
Returns:
Robo47_Mail_Transport_Multi *Provides Fluent Interface*

Definition at line 73 of file Multi.php.

Referenced by setTransports().

    {
        $this->_transports[] = $transport;
        return $this;
    }

Here is the caller graph for this function:

Robo47_Mail_Transport_Multi::getTransports (  ) 

Get Transports.

Returns:
array

Definition at line 84 of file Multi.php.

    {
        return $this->_transports;
    }

Robo47_Mail_Transport_Multi::removeTransport ( class  ) 

Remove Transport.

Parameters:
string|mixed $class
Returns:
Robo47_Mail_Transport_Multi *Provides Fluent Interface*

Definition at line 95 of file Multi.php.

    {
        foreach ($this->_transports as $key => $transport) {
            if (is_string($class)) {
                if ($transport instanceof $class) {
                    unset($this->_transports[$key]);
                }
            } elseif (is_object($class)) {
                if ($class === $transport) {
                    unset($this->_transports[$key]);
                }
            }
        }
        return $this;
    }

Robo47_Mail_Transport_Multi::send ( Zend_Mail $  mail  ) 

Send a mail using this transport.

Parameters:
Zend_Mail $mail public
Returns:
void
Exceptions:
Zend_Mail_Transport_Exception if mail is empty

Definition at line 119 of file Multi.php.

    {
        foreach ($this->_transports as $transport) {
            /* @var $transport Zend_Mail_Transport_Abstract */
            $transport->send($mail);
        }
    }

Robo47_Mail_Transport_Multi::setTransports ( transports  ) 

Set Transports.

Parameters:
array|Zend_Mail_Transport_Abstract $transports
Returns:
Robo47_Mail_Transport_Multi *Provides Fluent Interface*

Definition at line 55 of file Multi.php.

References addTransport().

Referenced by __construct().

    {
        if (is_array($transports)) {
            foreach ($transports as $transport) {
                $this->addTransport($transport);
            }
        } else {
            $this->addTransport($transports);
        }
        return $this;
    }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Robo47_Mail_Transport_Multi::$_transports = array() [protected]

Definition at line 39 of file Multi.php.


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