LocalSearchResponse.php 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. * @see Zend_Service_DeveloperGarden_Response_LocalSearch_LocalSearchResponseType
  28. */
  29. require_once 'Zend/Service/DeveloperGarden/Response/LocalSearch/LocalSearchResponseType.php';
  30. /**
  31. * @category Zend
  32. * @package Zend_Service
  33. * @subpackage DeveloperGarden
  34. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  35. * @author Marco Kaiser
  36. * @license http://framework.zend.com/license/new-bsd New BSD License
  37. */
  38. class Zend_Service_DeveloperGarden_Response_LocalSearch_LocalSearchResponse
  39. extends Zend_Service_DeveloperGarden_Response_BaseType
  40. {
  41. /**
  42. *
  43. * @var Zend_Service_DeveloperGarden_Response_LocalSearch_LocalSearchResponseType
  44. */
  45. public $searchResult = null;
  46. /**
  47. * constructor
  48. *
  49. * @param Zend_Service_DeveloperGarden_Response_LocalSearch_LocalSearchResponseType $response
  50. * @todo implement special result methods
  51. */
  52. public function __construct(
  53. Zend_Service_DeveloperGarden_Response_LocalSearch_LocalSearchResponseType $response
  54. ) {
  55. $this->errorCode = $response->getErrorCode();
  56. $this->errorMessage = $response->getErrorMessage();
  57. $this->statusCode = $response->getStatusCode();
  58. $this->statusMessage = $response->getStatusMessage();
  59. $this->searchResult = $response;
  60. }
  61. /**
  62. * returns the raw search result
  63. *
  64. * @return Zend_Service_DeveloperGarden_Response_LocalSearch_LocalSearchResponseType
  65. */
  66. public function getSearchResult()
  67. {
  68. return $this->searchResult;
  69. }
  70. /**
  71. * overwrite hasError to not handle 0103 error (empty result)
  72. *
  73. * @return boolean
  74. */
  75. public function hasError()
  76. {
  77. $result = parent::hasError();
  78. if (!$result && $this->statusCode == '0103') {
  79. $result = false;
  80. }
  81. return $result;
  82. }
  83. }