コード例 #1
0
ファイル: bullet.php プロジェクト: jordanmanning/ezpublish
 /**
  * Sets the property $name to $value.
  *
  * @throws ezcBasePropertyNotFoundException if the property does not exist.
  * @param string $name
  * @param mixed $value
  * @ignore
  */
 public function __set($name, $value)
 {
     switch ($name) {
         case 'bulletChar':
             if (!is_string($value) || iconv_strlen($value, 'UTF-8') !== 1) {
                 throw new ezcBaseValueException($name, $value, 'string, length = 1');
             }
             break;
         case 'numPrefix':
         case 'numSuffix':
             if (!is_string($value)) {
                 throw new ezcBaseValueException($name, $value, 'string');
             }
             break;
         default:
             return parent::__set($name, $value);
     }
     $this->properties[$name] = $value;
 }
コード例 #2
0
ファイル: number.php プロジェクト: axelmdev/ecommerce
 /**
  * Sets the property $name to $value.
  *
  * @throws ezcBasePropertyNotFoundException if the property does not exist.
  * @param string $name
  * @param mixed $value
  * @ignore
  */
 public function __set($name, $value)
 {
     switch ($name) {
         case 'numFormat':
             if (!is_string($value) && $value !== null) {
                 throw new ezcBaseValueException($name, $value, 'string or null');
             }
             break;
         case 'displayLevels':
         case 'startValue':
             if (!is_int($value)) {
                 throw new ezcBaseValueException($name, $value, 'int');
             }
             break;
         default:
             return parent::__set($name, $value);
     }
     $this->properties[$name] = $value;
 }