/zf/library/Zend/Service/Ebay/Finding/PaginationOutput.php

http://github.com/eryx/php-framework-benchmark · PHP · 115 lines · 18 code · 7 blank · 90 comment · 0 complexity · a974da88978eabee2c213816d97737b8 MD5 · raw file

  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. * @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-2011 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_PaginationOutput extends Zend_Service_Ebay_Finding_Abstract
  35. {
  36. /**
  37. * The maximum number of items that can be returned in the response.
  38. *
  39. * This number is always equal to the value input for
  40. * paginationInput.entriesPerPage. The end of the result set has been
  41. * reached if the number specified for entriesPerPage is greater than the
  42. * number of items found on the specified pageNumber. In this case, there
  43. * will be fewer items returned than the number specified in entriesPerPage.
  44. * This can be determined by comparing the entriesPerPage value with the
  45. * value returned in the count attribute for the searchResult field.
  46. *
  47. * @var integer
  48. */
  49. public $entriesPerPage;
  50. /**
  51. * The subset of item data returned in the current response.
  52. *
  53. * Search results are divided into sets, or "pages," of item data. The
  54. * number of pages is equal to the total number of items matching the search
  55. * criteria divided by the value specified for entriesPerPage in the
  56. * request. The response for a request contains one "page" of item data.
  57. *
  58. * This returned value indicates the page number of item data returned (a
  59. * subset of the complete result set). If this field contains 1, the
  60. * response contains the first page of item data (the default). If the value
  61. * returned in totalEntries is less than the value for entriesPerPage,
  62. * pageNumber returns 1 and the response contains the entire result set.
  63. *
  64. * The value of pageNumber is normally equal to the value input for
  65. * paginationInput.pageNumber. However, if the number input for pageNumber
  66. * is greater than the total possible pages of output, eBay returns the last
  67. * page of item data in the result set, and the value for pageNumber is set
  68. * to the respective (last) page number.
  69. *
  70. * @var integer
  71. */
  72. public $pageNumber;
  73. /**
  74. * The total number of items found that match the search criteria in your
  75. * request.
  76. *
  77. * Depending on the input value for entriesPerPage, the response might
  78. * include only a portion (a page) of the entire result set. A value of "0"
  79. * is returned if eBay does not find any items that match the search
  80. * criteria.
  81. *
  82. * @var integer
  83. */
  84. public $totalEntries;
  85. /**
  86. * The total number of pages of data that could be returned by repeated
  87. * search requests.
  88. *
  89. * Note that if you modify the value of inputPagination.entriesPerPage in a
  90. * request, the value output for totalPages will change. A value of "0" is
  91. * returned if eBay does not find any items that match the search criteria.
  92. *
  93. * @var integer
  94. */
  95. public $totalPages;
  96. /**
  97. * @return void
  98. */
  99. protected function _init()
  100. {
  101. parent::_init();
  102. $ns = Zend_Service_Ebay_Finding::XMLNS_FINDING;
  103. $this->entriesPerPage = $this->_query(".//$ns:entriesPerPage[1]", 'integer');
  104. $this->pageNumber = $this->_query(".//$ns:pageNumber[1]", 'integer');
  105. $this->totalEntries = $this->_query(".//$ns:totalEntries[1]", 'integer');
  106. $this->totalPages = $this->_query(".//$ns:totalPages[1]", 'integer');
  107. }
  108. }