File indexing completed on 2024-12-29 05:28:01

0001 <?php
0002 /**
0003  * Zend Framework
0004  *
0005  * LICENSE
0006  *
0007  * This source file is subject to the new BSD license that is bundled
0008  * with this package in the file LICENSE.txt.
0009  * It is also available through the world-wide-web at this URL:
0010  * http://framework.zend.com/license/new-bsd
0011  * If you did not receive a copy of the license and are unable to
0012  * obtain it through the world-wide-web, please send an email
0013  * to license@zend.com so we can send you a copy immediately.
0014  *
0015  * @category   Zend
0016  * @package    Zend_Service
0017  * @subpackage Ebay
0018  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
0019  * @license    http://framework.zend.com/license/new-bsd     New BSD License
0020  * @version    $Id: ListingInfo.php 22791 2010-08-04 16:11:47Z renanbr $
0021  */
0022 
0023 /**
0024  * @see Zend_Service_Ebay_Finding_Abstract
0025  */
0026 // require_once 'Zend/Service/Ebay/Finding/Abstract.php';
0027 
0028 /**
0029  * @category   Zend
0030  * @package    Zend_Service
0031  * @subpackage Ebay
0032  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
0033  * @license    http://framework.zend.com/license/new-bsd     New BSD License
0034  * @uses       Zend_Service_Ebay_Finding_Abstract
0035  */
0036 class Zend_Service_Ebay_Finding_ListingInfo extends Zend_Service_Ebay_Finding_Abstract
0037 {
0038     /**
0039      * Shows whether or not the seller will accept a best offer for the
0040      * associated item.
0041      *
0042      * Best Offer allows a buyer to make a lower-priced binding offer on a fixed
0043      * price item. Buyers cannot see how many offers have been made (only the
0044      * seller can see this information). To make a best offer on a listing, use
0045      * the eBay Web site.
0046      *
0047      * @var boolean
0048      */
0049     public $bestOfferEnabled;
0050 
0051     /**
0052      * Used with competitive-bid auctions, the associated item includes a Buy It
0053      * Now option if this value returns true.
0054      *
0055      * Buy It Now lets a user purchase the item at a fixed price, effectively
0056      * ending the auction. On most sites, the Buy It Now option is removed (and
0057      * this value returns false) once a valid bid is made on the associated item
0058      * (a valid bid could be a bid above the reserve price).
0059      *
0060      * @var boolean
0061      */
0062     public $buyItNowAvailable;
0063 
0064     /**
0065      * The Buy It Now Price of the item (if any), in the currency of the site on
0066      * which the item was listed.
0067      *
0068      * You can use this field to determine if the item was originally listed
0069      * with Buy It Now, even if the Buy It Now option is no longer available for
0070      * the item.
0071      *
0072      * For Basic Fixed-Price (FixedPrice), Store Inventory (StoreInventory), and
0073      * Ad Format (AdFormat) listings, currentPrice is the current fixed price.
0074      *
0075      * Only returned if an item was listed with Buy It Now.
0076      *
0077      * @var float
0078      */
0079     public $buyItNowPrice;
0080 
0081     /**
0082      * The listing's Buy It Now Price (if any), converted into the currency of
0083      * the site to which you sent your search request.
0084      *
0085      * For active items, refresh this value every 24 hours to pick up changes in
0086      * conversion rates (if this value has been converted).
0087      *
0088      * Price fields are returned as doubles, not necessarily in the traditional
0089      * monetary format of the site's country. For example, a US Dollar value
0090      * might be returned as 3.880001 instead of 3.88.
0091      *
0092      * Only returned if an item was listed with Buy It Now.
0093      *
0094      * @var float
0095      */
0096     public $convertedBuyItNowPrice;
0097 
0098     /**
0099      * Time stamp specifying when the listing is scheduled to end, or the actual
0100      * end time if the item listing has ended.
0101      *
0102      * This value is returned in GMT, the ISO 8601 date and time format
0103      * (YYYY-MM-DDTHH:MM:SS.SSSZ). See the "dateTime" type for information about
0104      * the time format, and for details on converting to and from the GMT time
0105      * zone.
0106      *
0107      * @var integer
0108      */
0109     public $endTime;
0110 
0111     /**
0112      * If true, a generic gift icon displays next the listing's title in search
0113      * and browse pages.
0114      *
0115      * @var boolean
0116      */
0117     public $gift;
0118 
0119     /**
0120      * The format of the listing, such as online auction, fixed price, or
0121      * advertisement.
0122      *
0123      * Applicable values:
0124      *
0125      *     AdFormat
0126      *     Advertisement to solicit inquiries on listings such as real estate.
0127      *     Permits no bidding on that item, service, or property. To express
0128      *     interest, a buyer fills out a contact form that eBay forwards to the
0129      *     seller as a lead. This format does not enable buyers and sellers to
0130      *     transact online through eBay and eBay Feedback is not available for
0131      *     ad format listings.
0132      *
0133      *     Auction
0134      *     Competitive-bid online auction format. Buyers engage in competitive
0135      *     bidding, although Buy It Now may be offered as long as no valid bids
0136      *     have been placed. Online auctions are listed on eBay.com; they can
0137      *     also be listed in a seller's eBay Store if the seller is a Store
0138      *     owner.
0139      *
0140      *     AuctionWithBIN
0141      *     Same as Auction format, but Buy It Now is enabled. AuctionWithBIN
0142      *     changes to Auction if a valid bid has been placed on the item. Valid
0143      *     bids include bids that are equal to or above any specified reserve
0144      *     price.
0145      *
0146      *     Classified
0147      *     Classified Ads connect buyers and sellers, who then complete the sale
0148      *     outside of eBay. This format does not enable buyers and sellers to
0149      *     transact online through eBay and eBay Feedback is not available for
0150      *     these listing types.
0151      *
0152      *     FixedPrice
0153      *     A fixed-price listing. Auction-style bidding is not allowed. On some
0154      *     sites, this auction format is also known as "Buy It Now Only" (not to
0155      *     be confused with the Buy It Now option available with
0156      *     competitive-bidding auctions). Fixed-price listings appear on
0157      *     eBay.com; they can also be listed in a seller's eBay Store if the
0158      *     seller is a Store owner.
0159      *
0160      *     StoreInventory
0161      *     A fixed-price format for eBay Store sellers. Store Inventory listings
0162      *     appear after other listings in regular browse and search item
0163      *     listings on eBay. Store items have a lower Insertion Fee and longer
0164      *     listing durations. This selling type can only be specified by sellers
0165      *     who have an eBay Store. Store Inventory listings are listed on
0166      *     eBay.com as well as in the seller's eBay Store.
0167      *
0168      * @var string
0169      */
0170     public $listingType;
0171 
0172     /**
0173      * Time stamp that eBay recorded as the moment the listing was made
0174      * available.
0175      *
0176      * This value is returned in GMT, the ISO 8601 date and time format
0177      * (YYYY-MM-DDTHH:MM:SS.SSSZ). See the "dateTime" type for information about
0178      * the time format, and for details on converting to and from the GMT time
0179      * zone. Note that it is possible for startTime to be different from the
0180      * value returned by GetSingleItem.
0181      *
0182      * @var integer
0183      */
0184     public $startTime;
0185 
0186     /**
0187      * @return void
0188      */
0189     protected function _init()
0190     {
0191         parent::_init();
0192         $ns = Zend_Service_Ebay_Finding::XMLNS_FINDING;
0193 
0194         $this->bestOfferEnabled       = $this->_query(".//$ns:bestOfferEnabled[1]", 'boolean');
0195         $this->buyItNowAvailable      = $this->_query(".//$ns:buyItNowAvailable[1]", 'boolean');
0196         $this->buyItNowPrice          = $this->_query(".//$ns:buyItNowPrice[1]", 'float');
0197         $this->convertedBuyItNowPrice = $this->_query(".//$ns:convertedBuyItNowPrice[1]", 'float');
0198         $this->endTime                = $this->_query(".//$ns:endTime[1]", 'string');
0199         $this->gift                   = $this->_query(".//$ns:gift[1]", 'boolean');
0200         $this->listingType            = $this->_query(".//$ns:listingType[1]", 'string');
0201         $this->startTime              = $this->_query(".//$ns:startTime[1]", 'string');
0202 
0203         $this->_attributes['buyItNowPrice'] = array(
0204             'currencyId' => $this->_query(".//$ns:buyItNowPrice[1]/@currencyId[1]", 'string')
0205         );
0206 
0207         $this->_attributes['convertedBuyItNowPrice'] = array(
0208             'currencyId' => $this->_query(".//$ns:convertedBuyItNowPrice[1]/@currencyId[1]", 'string')
0209         );
0210     }
0211 }