protected function takeChildFromDOM($child) { $absoluteNodeName = $child->namespaceURI . ':' . $child->localName; switch ($absoluteNodeName) { case $this->lookupNamespace('gd') . ':' . 'name': $item = new Zend_Gdata_Contacts_Extension_Name(); $item->transferFromDOM($child); $this->_names = $item; break; case $this->lookupNamespace('gContact') . ':' . 'birthday': $item = new Zend_Gdata_Contacts_Extension_Birthday(); $item->transferFromDOM($child); $this->_birthday = $item; break; case $this->lookupNamespace('gd') . ':' . 'phoneNumber': $item = new Zend_Gdata_Contacts_Extension_PhoneNumber(); $item->transferFromDOM($child); $this->_phones[] = $item; break; case $this->lookupNamespace('gd') . ':' . 'email': $item = new Zend_Gdata_Contacts_Extension_Email(); $item->transferFromDOM($child); $this->_emails[] = $item; break; case $this->lookupNamespace('gd') . ':' . 'structuredPostalAddress': $item = new Zend_Gdata_Contacts_Extension_Address(); $item->transferFromDOM($child); $this->_addresses[] = $item; break; case $this->lookupNamespace('gd') . ':' . 'organization': $item = new Zend_Gdata_Contacts_Extension_Organization(); $item->transferFromDOM($child); $this->_organization = $item; break; default: parent::takeChildFromDOM($child); break; } }
protected function takeChildFromDOM($child) { $absoluteNodeName = $child->namespaceURI . ':' . $child->localName; $gdNamespacePrefix = $this->lookupNamespace('gd') . ':'; switch ($absoluteNodeName) { case $gdNamespacePrefix . 'structuredPostalAddress': $address = new Zend_Gdata_Contacts_Extension_StructuredPostalAddress(); $address->transferFromDOM($child); $this->_addresses[] = $address; break; case $gdNamespacePrefix . 'category': $category = new Zend_Gdata_Contacts_Extension_Category(); $category->transferFromDOM($child); $this->_categories[] = $category; break; case $gdNamespacePrefix . 'email': $email = new Zend_Gdata_Contacts_Extension_Email(); $email->transferFromDOM($child); $this->_emails[] = $email; break; case $gdNamespacePrefix . 'extendedproperty': $extendedProperty = new Zend_Gdata_Contacts_Extension_ExtendedProperty(); $extendedProperty->transferFromDOM($child); $this->_extendedProperties[] = $extendedProperty; break; case $gdNamespacePrefix . 'im': $im = new Zend_Gdata_Contacts_Extension_Im(); $im->transferFromDOM($child); $this->_ims[] = $im; break; case $gdNamespacePrefix . 'name': $name = new Zend_Gdata_Contacts_Extension_Name(); $name->transferFromDOM($child); $this->_name = $name; break; //case $gdNamespacePrefix . 'notes': //case $gdNamespacePrefix . 'notes': case $this->lookupNamespace('atom') . ':' . 'notes': $notes = new Zend_Gdata_Contacts_Extension_Notes(); $notes->transferFromDOM($child); $this->_notes = $notes; break; case $gdNamespacePrefix . 'organization': $organization = new Zend_Gdata_Contacts_Extension_Organization(); $organization->transferFromDOM($child); $this->_organization = $organization; break; case $gdNamespacePrefix . 'phoneNumber': $phoneNumber = new Zend_Gdata_Contacts_Extension_PhoneNumber(); $phoneNumber->transferFromDOM($child); $this->_phones[] = $phoneNumber; break; default: parent::takeChildFromDOM($child); break; } }