Example #1
0
 /**
  * Sets a property.
  *
  * This method is called when an property is to be set.
  * 
  * @param string $propertyName The name of the property to set.
  * @param mixed $propertyValue The property value.
  * @return void
  * @ignore
  *
  * @throws ezcBasePropertyNotFoundException
  *         if the given property does not exist.
  * @throws ezcBaseValueException
  *         if the value to be assigned to a property is invalid.
  * @throws ezcBasePropertyPermissionException
  *         if the property to be set is a read-only property.
  */
 public function __set($propertyName, $propertyValue)
 {
     switch ($propertyName) {
         case 'body':
             throw new ezcBasePropertyPermissionException($propertyName, ezcBasePropertyPermissionException::READ);
         default:
             parent::__set($propertyName, $propertyValue);
     }
 }
Example #2
0
 /**
  * Sets a property.
  *
  * This method is called when an property is to be set.
  * 
  * @param string $propertyName The name of the property to set.
  * @param mixed $propertyValue The property value.
  * @return void
  * @ignore
  *
  * @throws ezcBasePropertyNotFoundException
  *         if the given property does not exist.
  * @throws ezcBaseValueException
  *         if the value to be assigned to a property is invalid.
  * @throws ezcBasePropertyPermissionException
  *         if the property to be set is a read-only property.
  */
 public function __set($propertyName, $propertyValue)
 {
     switch ($propertyName) {
         case 'propertyBehaviour':
             if (!$propertyValue instanceof ezcWebdavRequestPropertyBehaviourContent && $propertyValue !== null) {
                 throw new ezcBaseValueException($propertyName, $propertyValue, 'ezcWebdavRequestPropertyBehaviourContent');
             }
             break;
         default:
             parent::__set($propertyName, $propertyValue);
     }
     $this->properties[$propertyName] = $propertyValue;
 }
Example #3
0
 /**
  * Sets a property.
  *
  * This method is called when an property is to be set.
  * 
  * @param string $propertyName The name of the property to set.
  * @param mixed $propertyValue The property value.
  * @return void
  * @ignore
  *
  * @throws ezcBasePropertyNotFoundException
  *         if the given property does not exist.
  * @throws ezcBaseValueException
  *         if the value to be assigned to a property is invalid.
  * @throws ezcBasePropertyPermissionException
  *         if the property to be set is a read-only property.
  */
 public function __set($propertyName, $propertyValue)
 {
     switch ($propertyName) {
         case 'updates':
             if (!$propertyValue instanceof ezcWebdavFlaggedPropertyStorage) {
                 throw new ezcBaseValueException($propertyName, $propertyValue, 'ezcWebdavFlaggedPropertyStorage');
             }
             $this->properties[$propertyName] = $propertyValue;
             break;
         default:
             parent::__set($propertyName, $propertyValue);
     }
 }
Example #4
0
 /**
  * Sets a property.
  * This method is called when an property is to be set.
  * 
  * @param string $propertyName The name of the property to set.
  * @param mixed $propertyValue The property value.
  * @return void
  * @ignore
  *
  * @throws ezcBasePropertyNotFoundException
  *         if the given property does not exist.
  * @throws ezcBaseValueException
  *         if the value to be assigned to a property is invalid.
  * @throws ezcBasePropertyPermissionException
  *         if the property to be set is a read-only property.
  */
 public function __set($propertyName, $propertyValue)
 {
     switch ($propertyName) {
         case 'allProp':
             if (!is_bool($propertyValue)) {
                 throw new ezcBaseValueException($propertyName, $propertyValue, 'bool');
             }
             if ($propertyValue === true && ($this->propName === true || $this->prop !== null)) {
                 throw new ezcBaseValueException($propertyName, $propertyValue, '$propName and $prop must be null');
             }
             break;
         case 'propName':
             if (!is_bool($propertyValue)) {
                 throw new ezcBaseValueException($propertyName, $propertyValue, 'bool');
             }
             if ($propertyValue === true && ($this->allProp !== false || $this->prop !== null)) {
                 throw new ezcBaseValueException($propertyName, $propertyValue, '$allProp must be false and $prop must be null');
             }
             break;
         case 'prop':
             if (!$propertyValue instanceof ezcWebdavPropertyStorage && $propertyValue !== null) {
                 throw new ezcBaseValueException($propertyName, $propertyValue, 'ezcWebdavPropertyStorage');
             }
             if ($propertyValue !== null && ($this->allProp !== false || $this->propName === true)) {
                 throw new ezcBaseValueException($propertyName, $propertyValue, '$allProp must be false and $propName must be null');
             }
             break;
         default:
             parent::__set($propertyName, $propertyValue);
     }
     $this->properties[$propertyName] = $propertyValue;
 }