/** * 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 'headerTypes': if (!is_array($value)) { throw new ezcBaseValueException($name, $value, 'array'); } $this->properties[$name] = $value; break; case 'wordWrap': if (!is_numeric($value)) { throw new ezcBaseValueException($name, $value, 'int'); } $this->properties[$name] = (int) $value; break; case 'itemListCharacter': if (!in_array($value, $listCharacters = array('*', '-', '+', "•", "‣", "⁃"), true)) { throw new ezcBaseValueException($name, $value, 'Item list characters: ' . implode(', ', $listCharacters)); } $this->properties[$name] = $value; break; default: parent::__set($name, $value); } }
/** * 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 'linkConverter': if (!is_object($value) || !$value instanceof ezcDocumentEzXmlLinkConverter) { throw new ezcBaseValueException($name, $value, 'instanceof ezcDocumentEzXmlLinkConverter'); } $this->properties[$name] = $value; break; default: parent::__set($name, $value); } }
/** * 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 'wordWrap': if (!is_numeric($value)) { throw new ezcBaseValueException($name, $value, 'int'); } $this->properties[$name] = (int) $value; break; default: parent::__set($name, $value); } }
/** * 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 'xslt': $this->properties[$name] = (string) $value; break; case 'parameters': if (!is_array($value)) { throw new ezcBaseValueException($name, $value, 'array'); } $this->properties[$name] = $value; break; case 'failOnError': if (!is_bool($value)) { throw new ezcBaseValueException($name, $value, 'boolean'); } $this->properties[$name] = (bool) $value; break; default: parent::__set($name, $value); } }
/** * 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 'template': if (!is_string($value) || !is_file($value) || !is_readable($value)) { throw new ezcBaseValueException($name, $value, 'file, readable'); } break; case 'styler': if (!is_object($value) || !$value instanceof ezcDocumentOdtStyler) { throw new ezcBaseValueException($name, $value, 'ezcDocumentOdtStyler'); } break; case 'lengthMeasure': if (!is_string($value) || !in_array($value, self::$validLengthMeasures)) { throw new ezcBaseValueException($name, $value, implode(', ', self::$validLengthMeasures)); } break; default: parent::__set($name, $value); break; } $this->properties[$name] = $value; }
/** * 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 'formatOutput': case 'dublinCoreMetadata': if (!is_bool($value)) { throw new ezcBaseValueException($name, $value, 'boolean'); } $this->properties[$name] = $value; break; case 'styleSheets': if (!is_array($value) && !is_null($value)) { throw new ezcBaseValueException($name, $value, 'null OR array( URL )'); } $this->properties[$name] = $value; break; case 'styleSheet': $this->properties[$name] = (string) $value; break; case 'headerLevel': if (!is_int($value) || $value > 6 || $value < 0) { throw new ezcBaseValueException($name, $value, '0 < int < 7'); } $this->properties[$name] = $value; break; default: parent::__set($name, $value); } }