/**
  * Retrieves a DOMElement which corresponds to this element and all
  * child properties.  This is used to build an entry back into a DOM
  * and eventually XML text for application storage/persistence.
  *
  * @param DOMDocument $doc The DOMDocument used to construct DOMElements
  * @return DOMElement The DOMElement representing this element and all
  *          child properties.
  */
 public function getDOM($doc = null, $majorVersion = 1, $minorVersion = null)
 {
     $element = parent::getDOM($doc, $majorVersion, $minorVersion);
     if ($this->_who !== null) {
         $element->appendChild($this->_who->getDOM($element->ownerDocument));
     }
     return $element;
 }
예제 #2
0
 public function testExtensionAttributes()
 {
     $extensionAttributes = $this->who->extensionAttributes;
     $extensionAttributes['foo1'] = array('name' => 'foo1', 'value' => 'bar');
     $extensionAttributes['foo2'] = array('name' => 'foo2', 'value' => 'rab');
     $this->who->extensionAttributes = $extensionAttributes;
     $this->assertEquals('bar', $this->who->extensionAttributes['foo1']['value']);
     $this->assertEquals('rab', $this->who->extensionAttributes['foo2']['value']);
     $whoXml = $this->who->saveXML();
     $newWho = new Extension\Who();
     $newWho->transferFromXML($whoXml);
     $this->assertEquals('bar', $newWho->extensionAttributes['foo1']['value']);
     $this->assertEquals('rab', $newWho->extensionAttributes['foo2']['value']);
 }