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: PaginationOutput.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_PaginationOutput extends Zend_Service_Ebay_Finding_Abstract
0037 {
0038     /**
0039      * The maximum number of items that can be returned in the response.
0040      *
0041      * This number is always equal to the value input for
0042      * paginationInput.entriesPerPage. The end of the result set has been
0043      * reached if the number specified for entriesPerPage is greater than the
0044      * number of items found on the specified pageNumber. In this case, there
0045      * will be fewer items returned than the number specified in entriesPerPage.
0046      * This can be determined by comparing the entriesPerPage value with the
0047      * value returned in the count attribute for the searchResult field.
0048      *
0049      * @var integer
0050      */
0051     public $entriesPerPage;
0052 
0053     /**
0054      * The subset of item data returned in the current response.
0055      *
0056      * Search results are divided into sets, or "pages," of item data. The
0057      * number of pages is equal to the total number of items matching the search
0058      * criteria divided by the value specified for entriesPerPage in the
0059      * request. The response for a request contains one "page" of item data.
0060      *
0061      * This returned value indicates the page number of item data returned (a
0062      * subset of the complete result set). If this field contains 1, the
0063      * response contains the first page of item data (the default). If the value
0064      * returned in totalEntries is less than the value for entriesPerPage,
0065      * pageNumber returns 1 and the response contains the entire result set.
0066      *
0067      * The value of pageNumber is normally equal to the value input for
0068      * paginationInput.pageNumber. However, if the number input for pageNumber
0069      * is greater than the total possible pages of output, eBay returns the last
0070      * page of item data in the result set, and the value for pageNumber is set
0071      * to the respective (last) page number.
0072      *
0073      * @var integer
0074      */
0075     public $pageNumber;
0076 
0077     /**
0078      * The total number of items found that match the search criteria in your
0079      * request.
0080      *
0081      * Depending on the input value for entriesPerPage, the response might
0082      * include only a portion (a page) of the entire result set. A value of "0"
0083      * is returned if eBay does not find any items that match the search
0084      * criteria.
0085      *
0086      * @var integer
0087      */
0088     public $totalEntries;
0089 
0090     /**
0091      * The total number of pages of data that could be returned by repeated
0092      * search requests.
0093      *
0094      * Note that if you modify the value of inputPagination.entriesPerPage in a
0095      * request, the value output for totalPages will change. A value of "0" is
0096      * returned if eBay does not find any items that match the search criteria.
0097      *
0098      * @var integer
0099      */
0100     public $totalPages;
0101 
0102     /**
0103      * @return void
0104      */
0105     protected function _init()
0106     {
0107         parent::_init();
0108         $ns = Zend_Service_Ebay_Finding::XMLNS_FINDING;
0109 
0110         $this->entriesPerPage = $this->_query(".//$ns:entriesPerPage[1]", 'integer');
0111         $this->pageNumber     = $this->_query(".//$ns:pageNumber[1]", 'integer');
0112         $this->totalEntries   = $this->_query(".//$ns:totalEntries[1]", 'integer');
0113         $this->totalPages     = $this->_query(".//$ns:totalPages[1]", 'integer');
0114     }
0115 }