/** * Given a DOMNode representing an attribute, tries to map the data into * instance members. If no mapping is defined, the name and value are * stored in an array. * * @param DOMNode $attribute The DOMNode attribute needed to be handled */ protected function takeAttributeFromDOM($attribute) { switch ($attribute->localName) { case 'etag': // ETags are special, since they can be conveyed by either the // HTTP ETag header or as an XML attribute. $etag = $attribute->nodeValue; if (!$this->_etag instanceof Etag) { $this->_etag = $etag; } elseif ($this->_etag->getFieldValue() != $etag) { throw new App\IOException("ETag mismatch"); } break; default: parent::takeAttributeFromDOM($attribute); break; } }