ListingInfo.php 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  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: ListingInfo.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_ListingInfo extends Zend_Service_Ebay_Finding_Abstract
  35. {
  36. /**
  37. * Shows whether or not the seller will accept a best offer for the
  38. * associated item.
  39. *
  40. * Best Offer allows a buyer to make a lower-priced binding offer on a fixed
  41. * price item. Buyers cannot see how many offers have been made (only the
  42. * seller can see this information). To make a best offer on a listing, use
  43. * the eBay Web site.
  44. *
  45. * @var boolean
  46. */
  47. public $bestOfferEnabled;
  48. /**
  49. * Used with competitive-bid auctions, the associated item includes a Buy It
  50. * Now option if this value returns true.
  51. *
  52. * Buy It Now lets a user purchase the item at a fixed price, effectively
  53. * ending the auction. On most sites, the Buy It Now option is removed (and
  54. * this value returns false) once a valid bid is made on the associated item
  55. * (a valid bid could be a bid above the reserve price).
  56. *
  57. * @var boolean
  58. */
  59. public $buyItNowAvailable;
  60. /**
  61. * The Buy It Now Price of the item (if any), in the currency of the site on
  62. * which the item was listed.
  63. *
  64. * You can use this field to determine if the item was originally listed
  65. * with Buy It Now, even if the Buy It Now option is no longer available for
  66. * the item.
  67. *
  68. * For Basic Fixed-Price (FixedPrice), Store Inventory (StoreInventory), and
  69. * Ad Format (AdFormat) listings, currentPrice is the current fixed price.
  70. *
  71. * Only returned if an item was listed with Buy It Now.
  72. *
  73. * @var float
  74. */
  75. public $buyItNowPrice;
  76. /**
  77. * The listing's Buy It Now Price (if any), converted into the currency of
  78. * the site to which you sent your search request.
  79. *
  80. * For active items, refresh this value every 24 hours to pick up changes in
  81. * conversion rates (if this value has been converted).
  82. *
  83. * Price fields are returned as doubles, not necessarily in the traditional
  84. * monetary format of the site's country. For example, a US Dollar value
  85. * might be returned as 3.880001 instead of 3.88.
  86. *
  87. * Only returned if an item was listed with Buy It Now.
  88. *
  89. * @var float
  90. */
  91. public $convertedBuyItNowPrice;
  92. /**
  93. * Time stamp specifying when the listing is scheduled to end, or the actual
  94. * end time if the item listing has ended.
  95. *
  96. * This value is returned in GMT, the ISO 8601 date and time format
  97. * (YYYY-MM-DDTHH:MM:SS.SSSZ). See the "dateTime" type for information about
  98. * the time format, and for details on converting to and from the GMT time
  99. * zone.
  100. *
  101. * @var integer
  102. */
  103. public $endTime;
  104. /**
  105. * If true, a generic gift icon displays next the listing's title in search
  106. * and browse pages.
  107. *
  108. * @var boolean
  109. */
  110. public $gift;
  111. /**
  112. * The format of the listing, such as online auction, fixed price, or
  113. * advertisement.
  114. *
  115. * Applicable values:
  116. *
  117. * AdFormat
  118. * Advertisement to solicit inquiries on listings such as real estate.
  119. * Permits no bidding on that item, service, or property. To express
  120. * interest, a buyer fills out a contact form that eBay forwards to the
  121. * seller as a lead. This format does not enable buyers and sellers to
  122. * transact online through eBay and eBay Feedback is not available for
  123. * ad format listings.
  124. *
  125. * Auction
  126. * Competitive-bid online auction format. Buyers engage in competitive
  127. * bidding, although Buy It Now may be offered as long as no valid bids
  128. * have been placed. Online auctions are listed on eBay.com; they can
  129. * also be listed in a seller's eBay Store if the seller is a Store
  130. * owner.
  131. *
  132. * AuctionWithBIN
  133. * Same as Auction format, but Buy It Now is enabled. AuctionWithBIN
  134. * changes to Auction if a valid bid has been placed on the item. Valid
  135. * bids include bids that are equal to or above any specified reserve
  136. * price.
  137. *
  138. * Classified
  139. * Classified Ads connect buyers and sellers, who then complete the sale
  140. * outside of eBay. This format does not enable buyers and sellers to
  141. * transact online through eBay and eBay Feedback is not available for
  142. * these listing types.
  143. *
  144. * FixedPrice
  145. * A fixed-price listing. Auction-style bidding is not allowed. On some
  146. * sites, this auction format is also known as "Buy It Now Only" (not to
  147. * be confused with the Buy It Now option available with
  148. * competitive-bidding auctions). Fixed-price listings appear on
  149. * eBay.com; they can also be listed in a seller's eBay Store if the
  150. * seller is a Store owner.
  151. *
  152. * StoreInventory
  153. * A fixed-price format for eBay Store sellers. Store Inventory listings
  154. * appear after other listings in regular browse and search item
  155. * listings on eBay. Store items have a lower Insertion Fee and longer
  156. * listing durations. This selling type can only be specified by sellers
  157. * who have an eBay Store. Store Inventory listings are listed on
  158. * eBay.com as well as in the seller's eBay Store.
  159. *
  160. * @var string
  161. */
  162. public $listingType;
  163. /**
  164. * Time stamp that eBay recorded as the moment the listing was made
  165. * available.
  166. *
  167. * This value is returned in GMT, the ISO 8601 date and time format
  168. * (YYYY-MM-DDTHH:MM:SS.SSSZ). See the "dateTime" type for information about
  169. * the time format, and for details on converting to and from the GMT time
  170. * zone. Note that it is possible for startTime to be different from the
  171. * value returned by GetSingleItem.
  172. *
  173. * @var integer
  174. */
  175. public $startTime;
  176. /**
  177. * @return void
  178. */
  179. protected function _init()
  180. {
  181. parent::_init();
  182. $ns = Zend_Service_Ebay_Finding::XMLNS_FINDING;
  183. $this->bestOfferEnabled = $this->_query(".//$ns:bestOfferEnabled[1]", 'boolean');
  184. $this->buyItNowAvailable = $this->_query(".//$ns:buyItNowAvailable[1]", 'boolean');
  185. $this->buyItNowPrice = $this->_query(".//$ns:buyItNowPrice[1]", 'float');
  186. $this->convertedBuyItNowPrice = $this->_query(".//$ns:convertedBuyItNowPrice[1]", 'float');
  187. $this->endTime = $this->_query(".//$ns:endTime[1]", 'string');
  188. $this->gift = $this->_query(".//$ns:gift[1]", 'boolean');
  189. $this->listingType = $this->_query(".//$ns:listingType[1]", 'string');
  190. $this->startTime = $this->_query(".//$ns:startTime[1]", 'string');
  191. $this->_attributes['buyItNowPrice'] = array(
  192. 'currencyId' => $this->_query(".//$ns:buyItNowPrice[1]/@currencyId[1]", 'string')
  193. );
  194. $this->_attributes['convertedBuyItNowPrice'] = array(
  195. 'currencyId' => $this->_query(".//$ns:convertedBuyItNowPrice[1]/@currencyId[1]", 'string')
  196. );
  197. }
  198. }