Data.php 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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 Ebay
  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: Data.php 22791 2010-08-04 16:11:47Z renanbr $
  21. */
  22. /**
  23. * @see Zend_Service_Ebay_Finding_Abstract
  24. */
  25. require_once 'Zend/Service/Ebay/Finding/Abstract.php';
  26. /**
  27. * @category Zend
  28. * @package Zend_Service
  29. * @subpackage Ebay
  30. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  31. * @license http://framework.zend.com/license/new-bsd New BSD License
  32. * @uses Zend_Service_Ebay_Finding_Abstract
  33. */
  34. class Zend_Service_Ebay_Finding_Error_Data extends Zend_Service_Ebay_Finding_Abstract
  35. {
  36. /**
  37. * There are three categories of errors: request errors, application errors,
  38. * and system errors.
  39. *
  40. * @var string
  41. */
  42. public $category;
  43. /**
  44. * Name of the domain in which the error occurred.
  45. *
  46. * Domain values
  47. *
  48. * Marketplace: A business or validation error occurred in the service.
  49. *
  50. * SOA: An exception occurred in the Service Oriented Architecture (SOA)
  51. * framework.
  52. *
  53. * @var string
  54. */
  55. public $domain;
  56. /**
  57. * A unique code that identifies the particular error condition that
  58. * occurred. Your application can use error codes as identifiers in your
  59. * customized error-handling algorithms.
  60. *
  61. * @var integer
  62. */
  63. public $errorId;
  64. /**
  65. * Unique identifier for an exception associated with an error.
  66. *
  67. * @var string
  68. */
  69. public $exceptionId;
  70. /**
  71. * A detailed description of the condition that caused in the error.
  72. *
  73. * @var string
  74. */
  75. public $message;
  76. /**
  77. * Various warning and error messages return one or more variables that
  78. * contain contextual information about the error. This is often the field
  79. * or value that triggered the error.
  80. *
  81. * @var string[]
  82. */
  83. public $parameter;
  84. /**
  85. * Indicates whether the reported problem is fatal (an error) or is
  86. * less-severe (a warning). Review the error message details for information
  87. * on the cause.
  88. *
  89. * This API throws an exception when a fatal error occurs. Only warning
  90. * problems can fill this attribute. See more about error parsing at
  91. * {@Zend_Service_Ebay_Finding::_parseResponse()}.
  92. *
  93. * If the request fails and the application is the source of the error (for
  94. * example, a required element is missing), update the application before
  95. * you retry the request. If the problem is due to incorrect user data,
  96. * alert the end-user to the problem and provide the means for them to
  97. * correct the data. Once the problem in the application or data is
  98. * resolved, re-send the request to eBay.
  99. *
  100. * If the source of the problem is on eBay's side, you can retry the request
  101. * a reasonable number of times (eBay recommends you try the request twice).
  102. * If the error persists, contact Developer Technical Support. Once the
  103. * problem has been resolved, you can resend the request in its original
  104. * form.
  105. *
  106. * If a warning occurs, warning information is returned in addition to the
  107. * business data. Normally, you do not need to resend the request (as the
  108. * original request was successful). However, depending on the cause of the
  109. * warning, you might need to contact the end user, or eBay, to effect a
  110. * long term solution to the problem.
  111. *
  112. * @var string
  113. */
  114. public $severity;
  115. /**
  116. * Name of the subdomain in which the error occurred.
  117. *
  118. * Subdomain values
  119. *
  120. * Finding: The error is specific to the Finding service.
  121. *
  122. * MarketplaceCommon: The error is common to all Marketplace services.
  123. *
  124. * @var string
  125. */
  126. public $subdomain;
  127. /**
  128. * @return void
  129. */
  130. protected function _init()
  131. {
  132. parent::_init();
  133. $ns = Zend_Service_Ebay_Finding::XMLNS_FINDING;
  134. $this->category = $this->_query(".//$ns:category[1]", 'string');
  135. $this->domain = $this->_query(".//$ns:domain[1]", 'string');
  136. $this->errorId = $this->_query(".//$ns:errorId[1]", 'integer');
  137. $this->exceptionId = $this->_query(".//$ns:exceptionId[1]", 'string');
  138. $this->message = $this->_query(".//$ns:message[1]", 'string');
  139. $this->parameter = $this->_query(".//$ns:parameter", 'string', true);
  140. $this->severity = $this->_query(".//$ns:severity[1]", 'string');
  141. $this->subdomain = $this->_query(".//$ns:subdomain[1]", 'string');
  142. $this->_attributes['parameter'] = array(
  143. 'name' => $this->_query(".//$ns:parameter/@name", 'string', true)
  144. );
  145. }
  146. }