protected function __set($var, $value)
 {
     switch ($var) {
         case 'startMin':
             $var = 'start-min';
             $value = $this->formatTimestamp($value);
             break;
         case 'startMax':
             $var = 'start-max';
             $value = $this->formatTimestamp($value);
             break;
         case 'visibility':
         case 'projection':
             if (!Zend_Gdata_Data::isValid($value, $var)) {
                 throw Zend::exception('Zend_Gdata_Exception', "Unsupported {$var} value: '{$value}'");
             }
             $var = "_{$var}";
             break;
         case 'orderby':
             if (!Zend_Gdata_Data::isValid($value, 'orderby#calendar')) {
                 throw Zend::exception('Zend_Gdata_Exception', "Unsupported {$var} value: '{$value}'");
             }
             break;
         case 'user':
             $var = '_user';
             // @todo: validate user value
             break;
         case 'event':
             $var = '_event';
             // @todo: validate event value
             break;
         case 'comments':
             $var = '_comments';
             // @todo: validate comments subfeed value
             break;
         default:
             // other params are handled by parent
             break;
     }
     parent::__set($var, $value);
 }
Пример #2
0
 public function testGetValuesInvalid()
 {
     $this->assertFalse(Zend_Gdata_Data::getValues('Mxyzptlk!'));
 }