Example #1
0
 /**
  * Sets the option $name to $value.
  *
  * @throws ezcBasePropertyNotFoundException
  *         if the property $name is not defined
  * @throws ezcBaseValueException
  *         if $value is not correct for the property $name
  * @param string $name
  * @param mixed $value
  * @ignore
  */
 public function __set($name, $value)
 {
     switch ($name) {
         case 'authenticationMethod':
             if (!is_numeric($value)) {
                 throw new ezcBaseValueException($name, $value, 'int');
             }
             $this->properties[$name] = (int) $value;
             break;
         default:
             parent::__set($name, $value);
     }
 }
 /**
  * Sets the value of the option $name to $value.
  *
  * @throws ezcBasePropertyNotFoundException
  *         if the property $name is not defined
  * @throws ezcBaseValueException
  *         if $value is not correct for the property $name
  * @param string $name
  * @param mixed $value
  * @ignore
  */
 public function __set($name, $value)
 {
     switch ($name) {
         case 'uidReferencing':
             if (!is_bool($value)) {
                 throw new ezcBaseValueException($name, $value, 'bool');
             }
             $this->properties[$name] = $value;
             break;
         default:
             parent::__set($name, $value);
     }
 }
Example #3
0
 /**
  * Sets the option $name to $value.
  *
  * @throws ezcBasePropertyNotFoundException
  *         if the property $name is not defined
  * @throws ezcBaseValueException
  *         if $value is not correct for the property $name
  * @param string $name
  * @param mixed $value
  * @ignore
  */
 public function __set($name, $value)
 {
     switch ($name) {
         case 'connectionType':
             $this->properties[$name] = $value;
             break;
         case 'connectionOptions':
             if (!is_array($value)) {
                 throw new ezcBaseValueException($name, $value, 'array');
             }
             $this->properties[$name] = $value;
             break;
         case 'ssl':
             if (!is_bool($value)) {
                 throw new ezcBaseValueException($name, $value, 'bool');
             }
             $this->properties['connectionType'] = $value === true ? ezcMailSmtpTransport::CONNECTION_SSL : ezcMailSmtpTransport::CONNECTION_PLAIN;
             break;
         case 'preferredAuthMethod':
             $supportedAuthMethods = ezcMailSmtpTransport::getSupportedAuthMethods();
             $supportedAuthMethods[] = ezcMailSmtpTransport::AUTH_AUTO;
             if (!in_array($value, $supportedAuthMethods)) {
                 throw new ezcBaseValueException($name, $value, implode(' | ', $supportedAuthMethods));
             }
             $this->properties[$name] = $value;
             break;
         default:
             parent::__set($name, $value);
     }
 }