/**
  * 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 'tokenizer':
             if (!is_object($value) || !$value instanceof ezcDocumentWikiTokenizer) {
                 throw new ezcBaseValueException($name, $value, 'instanceof ezcDocumentWikiTokenizer');
             }
             $this->properties[$name] = $value;
             break;
         default:
             parent::__set($name, $value);
     }
 }
Example #2
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 'indentXml':
         case 'failOnError':
             if (!is_bool($value)) {
                 throw new ezcBaseValueException($name, $value, 'bool');
             }
             $this->properties[$name] = (bool) $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 'hyphenator':
             if (!$value instanceof ezcDocumentPdfHyphenator) {
                 throw new ezcBaseValueException($name, $value, 'instanceof ezcDocumentPdfHyphenator');
             }
             $this->properties[$name] = $value;
             break;
         case 'driver':
             if (!$value instanceof ezcDocumentPdfDriver) {
                 throw new ezcBaseValueException($name, $value, 'instanceof ezcDocumentPdfDriver');
             }
             $this->properties[$name] = $value;
             break;
         default:
             parent::__set($name, $value);
     }
 }
Example #4
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 'xhtmlVisitor':
             if (!is_string($value)) {
                 throw new ezcBaseValueException($name, $value, 'classname');
             }
             $this->properties[$name] = $value;
             break;
         case 'xhtmlVisitorOptions':
             if (!is_object($value) && $value instanceof ezcDocumentHtmlConverterOptions) {
                 throw new ezcBaseValueException($name, $value, 'instanceof ezcDocumentHtmlConverterOptions');
             }
             $this->properties[$name] = $value;
             break;
         default:
             parent::__set($name, $value);
     }
 }
Example #5
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 'hyphenator':
             if (!$value instanceof ezcDocumentPdfHyphenator) {
                 throw new ezcBaseValueException($name, $value, 'instanceof ezcDocumentPdfHyphenator');
             }
             $this->properties[$name] = $value;
             break;
         case 'tokenizer':
             if (!$value instanceof ezcDocumentPdfTokenizer) {
                 throw new ezcBaseValueException($name, $value, 'instanceof ezcDocumentPdfTokenizer');
             }
             $this->properties[$name] = $value;
             break;
         case 'driver':
             if (!$value instanceof ezcDocumentPdfDriver) {
                 throw new ezcBaseValueException($name, $value, 'instanceof ezcDocumentPdfDriver');
             }
             $this->properties[$name] = $value;
             break;
         case 'tableColumnWidthCalculator':
             if (!$value instanceof ezcDocumentPdfTableColumnWidthCalculator) {
                 throw new ezcBaseValueException($name, $value, 'instanceof ezcDocumentPdfTableColumnWidthCalculator');
             }
             $this->properties[$name] = $value;
             break;
         case 'compress':
             if (!is_bool($value)) {
                 throw new ezcBaseValueException($name, $value, 'bool');
             }
             $this->properties[$name] = $value;
             break;
         case 'ownerPassword':
         case 'userPassword':
             if (!is_string($value) && !is_null($value)) {
                 throw new ezcBaseValueException($name, $value, 'string OR null');
             }
             if ($name === 'userPassword' && $value !== null && $this->properties['ownerPassword'] === null) {
                 throw new ezcBaseValueException($name, $value, 'ownerPassword must be specified, before a userPassword can be set.');
             }
             $this->properties[$name] = $value;
             break;
         case 'permissions':
             if (!is_int($value)) {
                 throw new ezcBaseValueException($name, $value, 'Vitwise combination of ezcDocumentPdfOptions::EDIT, ezcDocumentPdfOptions::PRINTABLE, ezcDocumentPdfOptions::MODIFY, ezcDocumentPdfOptions::COPY');
             }
             $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 'footer':
         case 'showDocumentTitle':
         case 'showDocumentAuthor':
         case 'showPageNumber':
         case 'centerPageNumber':
             if (!is_bool($value)) {
                 throw new ezcBaseValueException($name, $value, 'boolean');
             }
             $this->properties[$name] = $value;
             break;
         case 'height':
             $this->properties[$name] = ezcDocumentPcssMeasure::create($value);
             break;
         case 'pageNumberOffset':
             if (!is_int($value)) {
                 throw new ezcBaseValueException($name, $value, 'int');
             }
             $this->properties[$name] = $value;
             break;
         default:
             parent::__set($name, $value);
     }
 }