registerAllNamespaces(Zend_Gdata_Contacts::$namespaces); parent::__construct(); } protected function takeChildFromDOM($child) { $absoluteNodeName = $child->namespaceURI . ':' . $child->localName; switch ($absoluteNodeName) { default: parent::takeChildFromDOM($child); break; } } /** * Extracts XML attributes from the DOM and converts them to the * appropriate object members. * * @param DOMNode $attribute The DOMNode attribute to be handled. */ protected function takeAttributeFromDOM($attribute) { switch ($attribute->localName) { case 'primary': if(strtolower($attribute->nodeValue) == 'true') $this->_isPrimary = true; else $this->_isPrimary = false; break; case 'rel': $this->_emailType = $attribute->nodeValue; break; case 'address': $this->_email = $attribute->nodeValue; break; default: parent::takeAttributeFromDOM($attribute); break; } } public function getEmailType() { if($this->_emailType == null) return ''; else return str_replace($this->lookupNamespace('gd') . '#', '', $this->_emailType); } public function getEmail() { return $this->_email; } public function isPrimary() { return $this->_isPrimary; } }