/zf/library/Zend/Service/Ebay/Finding/PaginationOutput.php
PHP | 115 lines | 18 code | 7 blank | 90 comment | 0 complexity | a974da88978eabee2c213816d97737b8 MD5 | raw file
Possible License(s): MIT, BSD-3-Clause, Apache-2.0, LGPL-2.1, LGPL-3.0, BSD-2-Clause
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-2011 Zend Technologies USA Inc. (http://www.zend.com) 19 * @license http://framework.zend.com/license/new-bsd New BSD License 20 * @version $Id: PaginationOutput.php 22791 2010-08-04 16:11:47Z renanbr $ 21 */ 22 23/** 24 * @see Zend_Service_Ebay_Finding_Abstract 25 */ 26require_once 'Zend/Service/Ebay/Finding/Abstract.php'; 27 28/** 29 * @category Zend 30 * @package Zend_Service 31 * @subpackage Ebay 32 * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) 33 * @license http://framework.zend.com/license/new-bsd New BSD License 34 * @uses Zend_Service_Ebay_Finding_Abstract 35 */ 36class Zend_Service_Ebay_Finding_PaginationOutput extends Zend_Service_Ebay_Finding_Abstract 37{ 38 /** 39 * The maximum number of items that can be returned in the response. 40 * 41 * This number is always equal to the value input for 42 * paginationInput.entriesPerPage. The end of the result set has been 43 * reached if the number specified for entriesPerPage is greater than the 44 * number of items found on the specified pageNumber. In this case, there 45 * will be fewer items returned than the number specified in entriesPerPage. 46 * This can be determined by comparing the entriesPerPage value with the 47 * value returned in the count attribute for the searchResult field. 48 * 49 * @var integer 50 */ 51 public $entriesPerPage; 52 53 /** 54 * The subset of item data returned in the current response. 55 * 56 * Search results are divided into sets, or "pages," of item data. The 57 * number of pages is equal to the total number of items matching the search 58 * criteria divided by the value specified for entriesPerPage in the 59 * request. The response for a request contains one "page" of item data. 60 * 61 * This returned value indicates the page number of item data returned (a 62 * subset of the complete result set). If this field contains 1, the 63 * response contains the first page of item data (the default). If the value 64 * returned in totalEntries is less than the value for entriesPerPage, 65 * pageNumber returns 1 and the response contains the entire result set. 66 * 67 * The value of pageNumber is normally equal to the value input for 68 * paginationInput.pageNumber. However, if the number input for pageNumber 69 * is greater than the total possible pages of output, eBay returns the last 70 * page of item data in the result set, and the value for pageNumber is set 71 * to the respective (last) page number. 72 * 73 * @var integer 74 */ 75 public $pageNumber; 76 77 /** 78 * The total number of items found that match the search criteria in your 79 * request. 80 * 81 * Depending on the input value for entriesPerPage, the response might 82 * include only a portion (a page) of the entire result set. A value of "0" 83 * is returned if eBay does not find any items that match the search 84 * criteria. 85 * 86 * @var integer 87 */ 88 public $totalEntries; 89 90 /** 91 * The total number of pages of data that could be returned by repeated 92 * search requests. 93 * 94 * Note that if you modify the value of inputPagination.entriesPerPage in a 95 * request, the value output for totalPages will change. A value of "0" is 96 * returned if eBay does not find any items that match the search criteria. 97 * 98 * @var integer 99 */ 100 public $totalPages; 101 102 /** 103 * @return void 104 */ 105 protected function _init() 106 { 107 parent::_init(); 108 $ns = Zend_Service_Ebay_Finding::XMLNS_FINDING; 109 110 $this->entriesPerPage = $this->_query(".//$ns:entriesPerPage[1]", 'integer'); 111 $this->pageNumber = $this->_query(".//$ns:pageNumber[1]", 'integer'); 112 $this->totalEntries = $this->_query(".//$ns:totalEntries[1]", 'integer'); 113 $this->totalPages = $this->_query(".//$ns:totalPages[1]", 'integer'); 114 } 115}