コード例 #1
0
ファイル: EventEntry.php プロジェクト: navassouza/zf2
 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;
     }
 }
コード例 #2
0
ファイル: LinkTest.php プロジェクト: rexmac/zf2
 public function testExtensionAttributes()
 {
     $extensionAttributes = $this->link->extensionAttributes;
     $extensionAttributes['foo1'] = array('name' => 'foo1', 'value' => 'bar');
     $extensionAttributes['foo2'] = array('name' => 'foo2', 'value' => 'rab');
     $this->link->extensionAttributes = $extensionAttributes;
     $this->assertEquals('bar', $this->link->extensionAttributes['foo1']['value']);
     $this->assertEquals('rab', $this->link->extensionAttributes['foo2']['value']);
     $linkXml = $this->link->saveXML();
     $newLink = new Extension\Link();
     $newLink->transferFromXML($linkXml);
     $this->assertEquals('bar', $newLink->extensionAttributes['foo1']['value']);
     $this->assertEquals('rab', $newLink->extensionAttributes['foo2']['value']);
 }