Beispiel #1
0
 protected function takeChildFromDOM($child)
 {
     $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
     switch ($absoluteNodeName) {
         case $this->lookupNamespace('gCal') . ':' . 'sendEventNotifications':
             $sendEventNotifications = new Extension\SendEventNotifications();
             $sendEventNotifications->transferFromDOM($child);
             $this->_sendEventNotifications = $sendEventNotifications;
             break;
         case $this->lookupNamespace('gCal') . ':' . 'timezone':
             $timezone = new Extension\Timezone();
             $timezone->transferFromDOM($child);
             $this->_timezone = $timezone;
             break;
         case $this->lookupNamespace('atom') . ':' . 'link':
             $link = new Extension\Link();
             $link->transferFromDOM($child);
             $this->_link[] = $link;
             break;
         case $this->lookupNamespace('gCal') . ':' . 'quickadd':
             $quickadd = new Extension\QuickAdd();
             $quickadd->transferFromDOM($child);
             $this->_quickadd = $quickadd;
             break;
         default:
             parent::takeChildFromDOM($child);
             break;
     }
 }
Beispiel #2
0
 public function testExtensionAttributes()
 {
     $extensionAttributes = $this->quickAdd->extensionAttributes;
     $extensionAttributes['foo1'] = array('name' => 'foo1', 'value' => 'bar');
     $extensionAttributes['foo2'] = array('name' => 'foo2', 'value' => 'rab');
     $this->quickAdd->extensionAttributes = $extensionAttributes;
     $this->assertEquals('bar', $this->quickAdd->extensionAttributes['foo1']['value']);
     $this->assertEquals('rab', $this->quickAdd->extensionAttributes['foo2']['value']);
     $quickAddXml = $this->quickAdd->saveXML();
     $newQuickAdd = new Extension\QuickAdd();
     $newQuickAdd->transferFromXML($quickAddXml);
     $this->assertEquals('bar', $newQuickAdd->extensionAttributes['foo1']['value']);
     $this->assertEquals('rab', $newQuickAdd->extensionAttributes['foo2']['value']);
 }