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->_isPrimaryNumber = true; else $this->_isPrimaryNumber = false; break; case 'rel': $this->_phoneType = $attribute->nodeValue; break; default: parent::takeAttributeFromDOM($attribute); break; } } public function getPhoneType() { return str_replace($this->lookupNamespace('gd') . '#', '', $this->_phoneType); } public function getNumber() { return $this->getText(); } public function isPrimary() { return $this->_isPrimaryNumber; } }