/** * Constructor. Do basic error checking on the resposne. * * @param DOMElement $element The DOM element we're encapsulating. */ public function __construct($element = null) { parent::__construct($element); if ($this['stat'] != 'ok') { throw new Horde_Service_Scribd_Exception($this->error['message'], $this->error['code']); } }
/** * Constructor. * * @param resource|string $xml The XML document received from the server. */ public function __construct($xml) { if (is_resource($xml)) { rewind($xml); $xml = stream_get_contents($xml); } parent::registerNamespace('xlink', 'http://www.w3.org/1999/xlink'); parent::__construct($xml); }