ConferenceCallAbstract.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <?php
  2. /**
  3. * Zend Framework
  4. *
  5. * LICENSE
  6. *
  7. * This source file is subject to the new BSD license that is bundled
  8. * with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://framework.zend.com/license/new-bsd
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@zend.com so we can send you a copy immediately.
  14. *
  15. * @category Zend
  16. * @package Zend_Service
  17. * @subpackage DeveloperGarden
  18. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. * @version $Id$
  21. */
  22. /**
  23. * @see Zend_Service_DeveloperGarden_Response_BaseType
  24. */
  25. require_once 'Zend/Service/DeveloperGarden/Response/BaseType.php';
  26. /**
  27. * @category Zend
  28. * @package Zend_Service
  29. * @subpackage DeveloperGarden
  30. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  31. * @author Marco Kaiser
  32. * @license http://framework.zend.com/license/new-bsd New BSD License
  33. */
  34. abstract class Zend_Service_DeveloperGarden_Response_ConferenceCall_ConferenceCallAbstract
  35. extends Zend_Service_DeveloperGarden_Response_BaseType
  36. {
  37. /**
  38. * returns the response object or null
  39. *
  40. * @return mixed
  41. */
  42. public function getResponse()
  43. {
  44. $r = new ReflectionClass($this);
  45. foreach ($r->getProperties() as $p) {
  46. $name = $p->getName();
  47. if (strpos($name, 'Response') !== false) {
  48. return $p->getValue($this);
  49. }
  50. }
  51. return null;
  52. }
  53. /**
  54. * parse the response data and throws exceptions
  55. *
  56. * @throws Zend_Service_DeveloperGarden_Response_Exception
  57. * @return mixed
  58. */
  59. public function parse()
  60. {
  61. $retVal = $this->getResponse();
  62. if ($retVal === null) {
  63. $this->statusCode = 9999;
  64. $this->statusMessage = 'Internal response property not found.';
  65. } else {
  66. $this->statusCode = $retVal->getStatusCode();
  67. $this->statusMessage = $retVal->getStatusMessage();
  68. }
  69. parent::parse();
  70. return $retVal;
  71. }
  72. }