Esempio n. 1
0
 protected function takeChildFromDOM($child)
 {
     $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
     switch ($absoluteNodeName) {
         case $this->lookupNamespace('gCal') . ':' . 'accesslevel':
             $accessLevel = new Zend_Gdata_Calendar_Extension_AccessLevel();
             $accessLevel->transferFromDOM($child);
             $this->_accessLevel = $accessLevel;
             break;
         case $this->lookupNamespace('gCal') . ':' . 'color':
             $color = new Zend_Gdata_Calendar_Extension_Color();
             $color->transferFromDOM($child);
             $this->_color = $color;
             break;
         case $this->lookupNamespace('gCal') . ':' . 'hidden':
             $hidden = new Zend_Gdata_Calendar_Extension_Hidden();
             $hidden->transferFromDOM($child);
             $this->_hidden = $hidden;
             break;
         case $this->lookupNamespace('gCal') . ':' . 'selected':
             $selected = new Zend_Gdata_Calendar_Extension_Selected();
             $selected->transferFromDOM($child);
             $this->_selected = $selected;
             break;
         case $this->lookupNamespace('gCal') . ':' . 'timezone':
             $timezone = new Zend_Gdata_Calendar_Extension_Timezone();
             $timezone->transferFromDOM($child);
             $this->_timezone = $timezone;
             break;
         case $this->lookupNamespace('gd') . ':' . 'where':
             $where = new Zend_Gdata_Extension_Where();
             $where->transferFromDOM($child);
             $this->_where[] = $where;
             break;
         default:
             parent::takeChildFromDOM($child);
             break;
     }
 }
Esempio n. 2
0
 public function testExtensionAttributes()
 {
     $extensionAttributes = $this->selected->extensionAttributes;
     $extensionAttributes['foo1'] = array('name' => 'foo1', 'value' => 'bar');
     $extensionAttributes['foo2'] = array('name' => 'foo2', 'value' => 'rab');
     $this->selected->extensionAttributes = $extensionAttributes;
     $this->assertEquals('bar', $this->selected->extensionAttributes['foo1']['value']);
     $this->assertEquals('rab', $this->selected->extensionAttributes['foo2']['value']);
     $selectedXml = $this->selected->saveXML();
     $newSelected = new Zend_Gdata_Calendar_Extension_Selected();
     $newSelected->transferFromXML($selectedXml);
     $this->assertEquals('bar', $newSelected->extensionAttributes['foo1']['value']);
     $this->assertEquals('rab', $newSelected->extensionAttributes['foo2']['value']);
 }