3 * File containing the ezcMailTransportOption class
7 * @copyright Copyright (C) 2005-2009 eZ Systems AS. All rights reserved.
8 * @license http://ez.no/licenses/new_bsd New BSD License
12 * Class containing the basic options for mail transports.
14 * @property int $timeout
15 * Specifies the time in seconds until the connection is closed if
16 * there is no activity through the connection.
18 * Specifies whether to use an SSL connection or not.
23 class ezcMailTransportOptions
extends ezcBaseOptions
26 * Constructs an object with the specified values.
28 * @throws ezcBasePropertyNotFoundException
29 * if $options contains a property not defined
30 * @throws ezcBaseValueException
31 * if $options contains a property with a value not allowed
32 * @param array(string=>mixed) $options
34 public function __construct( array $options = array() )
36 $this->timeout
= 5; // default value for timeout is 5 seconds
37 $this->ssl
= false; // default value for ssl is false
39 parent
::__construct( $options );
43 * Sets the option $name to $value.
45 * @throws ezcBasePropertyNotFoundException
46 * if the property $name is not defined
47 * @throws ezcBaseValueException
48 * if $value is not correct for the property $name
53 public function __set( $name, $value )
58 if ( !is_numeric( $value ) ||
( $value < 1 ) )
60 throw new ezcBaseValueException( $name, $value, 'int >= 1' );
62 $this->properties
[$name] = (int) $value;
66 if ( !is_bool( $value ) )
68 throw new ezcBaseValueException( $name, $value, 'bool' );
70 $this->properties
[$name] = $value;
74 throw new ezcBasePropertyNotFoundException( $name );