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