1: <?php
2: /**
3: * Copyright 2008-2012 Horde LLC (http://www.horde.org/)
4: *
5: * @author Chuck Hagenbuch <chuck@horde.org>
6: * @license http://www.horde.org/licenses/bsd BSD
7: * @category Horde
8: * @package Service_Scribd
9: */
10:
11: /**
12: * Scribd response class
13: *
14: * @author Chuck Hagenbuch <chuck@horde.org>
15: * @license http://www.horde.org/licenses/bsd BSD
16: * @category Horde
17: * @package Service_Scribd
18: */
19: class Horde_Service_Scribd_Response extends Horde_Xml_Element
20: {
21: /**
22: * Constructor. Do basic error checking on the resposne.
23: *
24: * @param DOMElement $element The DOM element we're encapsulating.
25: */
26: public function __construct($element = null)
27: {
28: parent::__construct($element);
29:
30: if ($this['stat'] != 'ok') {
31: throw new Horde_Service_Scribd_Exception($this->error['message'], $this->error['code']);
32: }
33: }
34:
35: /*
36: if($result['stat'] == "ok"){
37:
38: //This is shifty. Works currently though.
39: $result = $this->convert_simplexml_to_array($result);
40: if(urlencode((string)$result) == "%0A%0A" && $this->error == 0){
41: $result = "1";
42: return $result;
43: }else{
44: return $result;
45: }
46: }
47: */
48:
49: public function getResultSet()
50: {
51: return new Horde_Service_Scribd_ResultSet($this->resultset);
52: }
53:
54: }
55: