commiting uncommited changes on live site
[weblabels.fsf.org.git] / crm.fsf.org / 20131203 / files / sites / all / modules-new / civicrm / packages / ezc / Mail / src / options / pop3_options.php
1 <?php
2 /**
3 * File containing the ezcMailPop3TransportOptions class
4 *
5 * @package Mail
6 * @version 1.7beta1
7 * @copyright Copyright (C) 2005-2009 eZ Systems AS. All rights reserved.
8 * @license http://ez.no/licenses/new_bsd New BSD License
9 */
10
11 /**
12 * Class containing the options for POP3 transport.
13 *
14 * The options from {@link ezcMailTransportOptions} are inherited.
15 *
16 * Example of how to use POP3 transport options:
17 * <code>
18 * $options = new ezcMailPop3TransportOptions();
19 * $options->ssl = true;
20 * $options->timeout = 3;
21 * $options->authenticationMethod = ezcMailPop3Transport::AUTH_APOP;
22 *
23 * $pop3 = new ezcMailPop3Transport( 'pop3.example.com', null, $options );
24 * </code>
25 *
26 * @property int $authenticationMethod
27 * Specifies the method to connect to the POP3 transport. The methods
28 * supported are {@link ezcMailPop3Transport::AUTH_PLAIN_TEXT} and
29 * {@link ezcMailPop3Transport::AUTH_APOP}.
30 *
31 * @package Mail
32 * @version 1.7beta1
33 */
34 class ezcMailPop3TransportOptions extends ezcMailTransportOptions
35 {
36 /**
37 * Constructs an object with the specified values.
38 *
39 * @throws ezcBasePropertyNotFoundException
40 * if $options contains a property not defined
41 * @throws ezcBaseValueException
42 * if $options contains a property with a value not allowed
43 * @param array(string=>mixed) $options
44 */
45 public function __construct( array $options = array() )
46 {
47 // default authentication method is PLAIN
48 $this->authenticationMethod = ezcMailPop3Transport::AUTH_PLAIN_TEXT;
49
50 parent::__construct( $options );
51 }
52
53 /**
54 * Sets the option $name to $value.
55 *
56 * @throws ezcBasePropertyNotFoundException
57 * if the property $name is not defined
58 * @throws ezcBaseValueException
59 * if $value is not correct for the property $name
60 * @param string $name
61 * @param mixed $value
62 * @ignore
63 */
64 public function __set( $name, $value )
65 {
66 switch ( $name )
67 {
68 case 'authenticationMethod':
69 if ( !is_numeric( $value ) )
70 {
71 throw new ezcBaseValueException( $name, $value, 'int' );
72 }
73 $this->properties[$name] = (int) $value;
74 break;
75
76 default:
77 parent::__set( $name, $value );
78 }
79 }
80 }
81 ?>