SellingStatus.php 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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: SellingStatus.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-2010 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_SellingStatus extends Zend_Service_Ebay_Finding_Abstract
  35. {
  36. /**
  37. * The number of bids that have been placed on the item.
  38. *
  39. * @var integer
  40. */
  41. public $bidCount;
  42. /**
  43. * The listing's current price converted to the currency of the site
  44. * specified in the find request (globalId).
  45. *
  46. * @var float
  47. */
  48. public $convertedCurrentPrice;
  49. /**
  50. * Currency in which the monetary amount is specified.
  51. *
  52. * @link http://developer.ebay.com/DevZone/finding/CallRef/Enums/currencyIdList.html
  53. * @var string
  54. */
  55. public $convertedCurrentPrice_currencyId;
  56. /**
  57. * The current price of the item given in the currency of the site on which
  58. * the item is listed.
  59. *
  60. * That is, currentPrice is returned in the original listing currency.
  61. *
  62. * For competitive-bid item listings, currentPrice is the current minimum
  63. * bid price if the listing has no bids, or the current high bid if the
  64. * listing has bids. A Buy It Now price has no effect on currentPrice.
  65. *
  66. * For Basic Fixed-Price (FixedPrice), Store Inventory (StoreInventory), and
  67. * Ad Format (AdFormat) listings, currentPrice is the current fixed price.
  68. *
  69. * @var float
  70. */
  71. public $currentPrice;
  72. /**
  73. * Currency in which the monetary amount is specified.
  74. *
  75. * @link http://developer.ebay.com/DevZone/finding/CallRef/Enums/currencyIdList.html
  76. * @var string
  77. */
  78. public $currentPrice_currencyId;
  79. /**
  80. * Specifies the listing's status in eBay's processing workflow.
  81. *
  82. * If an item's EndTime is in the past, but there are no details about the
  83. * buyer or high bidder (and the user is not anonymous), you can use
  84. * sellingState information to determine whether eBay has finished
  85. * processing the listing.
  86. *
  87. * Applicable values:
  88. *
  89. * Active
  90. * The listing is still live. It is also possible that the auction has
  91. * recently ended, but eBay has not completed the final processing
  92. * (e.g., the high bidder is still being determined).
  93. *
  94. * Canceled
  95. * The listing has been canceled by either the seller or eBay.
  96. *
  97. * Ended
  98. * The listing has ended and eBay has completed the processing of the
  99. * sale (if any).
  100. *
  101. * @var string
  102. */
  103. public $sellingState;
  104. /**
  105. * Time left before the listing ends.
  106. *
  107. * The duration is represented in the ISO 8601 duration format
  108. * (PnYnMnDTnHnMnS). For listings that have ended, the time left is PT0S
  109. * (zero seconds). See the "duration" type for information about this time
  110. * format.
  111. *
  112. * @var string
  113. */
  114. public $timeLeft;
  115. /**
  116. * @return void
  117. */
  118. protected function _init()
  119. {
  120. parent::_init();
  121. $ns = Zend_Service_Ebay_Finding::XMLNS_FINDING;
  122. $this->bidCount = $this->_query(".//$ns:bidCount[1]", 'integer');
  123. $this->convertedCurrentPrice = $this->_query(".//$ns:convertedCurrentPrice[1]", 'float');
  124. $this->convertedCurrentPrice_currencyId = $this->_query(".//$ns:convertedCurrentPrice[1]/@currencyId[1]", 'string');
  125. $this->currentPrice = $this->_query(".//$ns:currentPrice[1]", 'float');
  126. $this->currentPrice_currencyId = $this->_query(".//$ns:currentPrice[1]/@currencyId[1]", 'string');
  127. $this->sellingState = $this->_query(".//$ns:sellingState[1]", 'string');
  128. $this->timeLeft = $this->_query(".//$ns:timeLeft[1]", 'string');
  129. }
  130. }