* $options = new ezcMailParserOptions(); * $options->mailClass = 'ezcMail'; * * $parser = new ezcMailParser( $options ); * * * @property int $mailClass * Specifies a class descending from ezcMail which can be returned by the * parser if you plan to use another class instead of ezcMail. * * @package Mail * @version 1.5.1 */ class ezcMailParserOptions extends ezcBaseOptions { /** * Constructs an object with the specified values. * * @throws ezcBasePropertyNotFoundException * if $options contains a property not defined * @throws ezcBaseValueException * if $options contains a property with a value not allowed * @param array(string=>mixed) $options */ public function __construct( array $options = array() ) { $this->mailClass = 'ezcMail'; // default value for mail class is 'ezcMail' parent::__construct( $options ); } /** * Sets the option $propertyName to $propertyValue. * * @throws ezcBasePropertyNotFoundException * if the property $propertyName is not defined * @throws ezcBaseValueException * if $propertyValue is not correct for the property $propertyName * @throws ezcBaseInvalidParentClassException * if the class name passed as replacement mailClass does not * inherit from ezcMail. * @param string $propertyName * @param mixed $propertyValue * @ignore */ public function __set( $propertyName, $propertyValue ) { switch ( $propertyName ) { case 'mailClass': if ( !is_string( $propertyValue ) ) { throw new ezcBaseValueException( $propertyName, $propertyValue, 'string that contains a class name' ); } // Check if the passed classname actually implements the // correct parent class. if ( 'ezcMail' !== $propertyValue && !in_array( 'ezcMail', class_parents( $propertyValue ) ) ) { throw new ezcBaseInvalidParentClassException( 'ezcMail', $propertyValue ); } $this->properties[$propertyName] = $propertyValue; break; default: throw new ezcBasePropertyNotFoundException( $propertyName ); } } } ?>