Example #1
0
 /**
  * Creates individual Entry objects of the appropriate type and
  * stores them as members of this entry based upon DOM data.
  *
  * @param DOMNode $child The DOMNode to process
  */
 protected function takeChildFromDOM($child)
 {
     $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
     switch ($absoluteNodeName) {
         case $this->lookupNamespace('gCal') . ':' . 'webContent':
             $webContent = new Zend_Gdata_Calendar_Extension_WebContent();
             $webContent->transferFromDOM($child);
             $this->_webContent = $webContent;
             break;
         default:
             parent::takeChildFromDOM($child);
             break;
     }
 }
 public function testExtensionAttributes()
 {
     $extensionAttributes = $this->webContent->extensionAttributes;
     $extensionAttributes['foo1'] = array('name' => 'foo1', 'value' => 'bar');
     $extensionAttributes['foo2'] = array('name' => 'foo2', 'value' => 'rab');
     $this->webContent->extensionAttributes = $extensionAttributes;
     $this->assertEquals('bar', $this->webContent->extensionAttributes['foo1']['value']);
     $this->assertEquals('rab', $this->webContent->extensionAttributes['foo2']['value']);
     $webContentXml = $this->webContent->saveXML();
     $newWebContent = new Zend_Gdata_Calendar_Extension_WebContent();
     $newWebContent->transferFromXML($webContentXml);
     $this->assertEquals('bar', $newWebContent->extensionAttributes['foo1']['value']);
     $this->assertEquals('rab', $newWebContent->extensionAttributes['foo2']['value']);
 }
Example #3
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') . ':' . 'webContent':
             $webcontent = new Zend_Gdata_Calendar_Extension_WebContent();
             $webcontent->transferFromDOM($child);
             $this->_webContent = $webcontent;
             break;
         case $this->lookupNamespace('gCal') . ':' . 'timezone':
             $timezone = new Zend_Gdata_Calendar_Extension_Timezone();
             $timezone->transferFromDOM($child);
             $this->_timezone = $timezone;
             break;
         default:
             parent::takeChildFromDOM($child);
             break;
     }
 }