SellingStatus.php 4.3 KB

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