/zf/library/Zend/Service/Amazon/SimpleDb/Page.php

http://github.com/eryx/php-framework-benchmark · PHP · 97 lines · 29 code · 8 blank · 60 comment · 0 complexity · e8137663b8354765119fd00f1b4b9762 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_Amazon
  17. * @subpackage SimpleDb
  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. */
  21. /**
  22. * @see Zend_Service_Amazon_Exception
  23. */
  24. require_once 'Zend/Service/Amazon/Exception.php';
  25. /**
  26. * The Custom Exception class that allows you to have access to the AWS Error Code.
  27. *
  28. * @category Zend
  29. * @package Zend_Service_Amazon
  30. * @subpackage SimpleDb
  31. * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
  32. * @license http://framework.zend.com/license/new-bsd New BSD License
  33. */
  34. class Zend_Service_Amazon_SimpleDb_Page
  35. {
  36. /** @var string Page data */
  37. protected $_data;
  38. /** @var string|null Token identifying page */
  39. protected $_token;
  40. /**
  41. * Constructor
  42. *
  43. * @param string $data
  44. * @param string|null $token
  45. * @return void
  46. */
  47. public function __construct($data, $token = null)
  48. {
  49. $this->_data = $data;
  50. $this->_token = $token;
  51. }
  52. /**
  53. * Retrieve page data
  54. *
  55. * @return string
  56. */
  57. public function getData()
  58. {
  59. return $this->_data;
  60. }
  61. /**
  62. * Retrieve token
  63. *
  64. * @return string|null
  65. */
  66. public function getToken()
  67. {
  68. return $this->_token;
  69. }
  70. /**
  71. * Determine whether this is the last page of data
  72. *
  73. * @return void
  74. */
  75. public function isLast()
  76. {
  77. return (null === $this->_token);
  78. }
  79. /**
  80. * Cast to string
  81. *
  82. * @return string
  83. */
  84. public function __toString()
  85. {
  86. return "Page with token: " . $this->_token
  87. . "\n and data: " . $this->_data;
  88. }
  89. }