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

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: SellingStatus.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_SellingStatus extends Zend_Service_Ebay_Finding_Abstract
0037 {
0038     /**
0039      * The number of bids that have been placed on the item.
0040      *
0041      * @var integer
0042      */
0043     public $bidCount;
0044 
0045     /**
0046      * The listing's current price converted to the currency of the site
0047      * specified in the find request (globalId).
0048      *
0049      * @var float
0050      */
0051     public $convertedCurrentPrice;
0052 
0053     /**
0054      * The current price of the item given in the currency of the site on which
0055      * the item is listed.
0056      *
0057      * That is, currentPrice is returned in the original listing currency.
0058      *
0059      * For competitive-bid item listings, currentPrice is the current minimum
0060      * bid price if the listing has no bids, or the current high bid if the
0061      * listing has bids. A Buy It Now price has no effect on currentPrice.
0062      *
0063      * For Basic Fixed-Price (FixedPrice), Store Inventory (StoreInventory), and
0064      * Ad Format (AdFormat) listings, currentPrice is the current fixed price.
0065      *
0066      * @var float
0067      */
0068     public $currentPrice;
0069 
0070     /**
0071      * Specifies the listing's status in eBay's processing workflow.
0072      *
0073      * If an item's EndTime is in the past, but there are no details about the
0074      * buyer or high bidder (and the user is not anonymous), you can use
0075      * sellingState information to determine whether eBay has finished
0076      * processing the listing.
0077      *
0078      * Applicable values:
0079      *
0080      *     Active
0081      *     The listing is still live. It is also possible that the auction has
0082      *     recently ended, but eBay has not completed the final processing
0083      *     (e.g., the high bidder is still being determined).
0084      *
0085      *     Canceled
0086      *     The listing has been canceled by either the seller or eBay.
0087      *
0088      *     Ended
0089      *     The listing has ended and eBay has completed the processing of the
0090      *     sale (if any).
0091      *
0092      * @var string
0093      */
0094     public $sellingState;
0095 
0096     /**
0097      * Time left before the listing ends.
0098      *
0099      * The duration is represented in the ISO 8601 duration format
0100      * (PnYnMnDTnHnMnS). For listings that have ended, the time left is PT0S
0101      * (zero seconds). See the "duration" type for information about this time
0102      * format.
0103      *
0104      * @var string
0105      */
0106     public $timeLeft;
0107 
0108     /**
0109      * @return void
0110      */
0111     protected function _init()
0112     {
0113         parent::_init();
0114         $ns = Zend_Service_Ebay_Finding::XMLNS_FINDING;
0115 
0116         $this->bidCount              = $this->_query(".//$ns:bidCount[1]", 'integer');
0117         $this->convertedCurrentPrice = $this->_query(".//$ns:convertedCurrentPrice[1]", 'float');
0118         $this->currentPrice          = $this->_query(".//$ns:currentPrice[1]", 'float');
0119         $this->sellingState          = $this->_query(".//$ns:sellingState[1]", 'string');
0120         $this->timeLeft              = $this->_query(".//$ns:timeLeft[1]", 'string');
0121 
0122         $this->_attributes['convertedCurrentPrice'] = array(
0123             'currencyId' => $this->_query(".//$ns:convertedCurrentPrice[1]/@currencyId[1]", 'string')
0124         );
0125 
0126         $this->_attributes['currentPrice'] = array(
0127             'currencyId' => $this->_query(".//$ns:currentPrice[1]/@currencyId[1]", 'string')
0128         );
0129     }
0130 }