125 lines
2.6 KiB
PHP
Raw Normal View History

2013-06-19 09:13:51 +00:00
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Service_Amazon
* @subpackage SimpleDb
2015-01-19 20:45:05 +00:00
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
2013-06-19 09:13:51 +00:00
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
/**
* @see Zend_Service_Amazon_Exception
*/
require_once 'Zend/Service/Amazon/Exception.php';
/**
* The Custom Exception class that allows you to have access to the AWS Error Code.
*
* @category Zend
* @package Zend_Service_Amazon
* @subpackage SimpleDb
2015-01-19 20:45:05 +00:00
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
2013-06-19 09:13:51 +00:00
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Service_Amazon_SimpleDb_Page
{
2015-01-19 20:45:05 +00:00
/**
* Page data
*
* @var string
*/
2013-06-19 09:13:51 +00:00
protected $_data;
2015-01-19 20:45:05 +00:00
/**
* Token identifying page
*
* @var string|null
*/
2013-06-19 09:13:51 +00:00
protected $_token;
/**
* Constructor
*
2015-01-19 20:45:05 +00:00
* @param string $data
* @param string|null $token
2013-06-19 09:13:51 +00:00
*/
public function __construct($data, $token = null)
{
2015-01-19 20:45:05 +00:00
$this->setData($data);
$this->setToken($token);
}
/**
* Set page data
*
* @param string $data
*/
public function setData($data)
{
$this->_data = $data;
2013-06-19 09:13:51 +00:00
}
/**
* Retrieve page data
*
* @return string
*/
public function getData()
{
return $this->_data;
}
2015-01-19 20:45:05 +00:00
/**
* Set token
*
* @param string|null $token
*/
public function setToken($token)
{
$this->_token = (trim($token) === '') ? null : $token;
}
2013-06-19 09:13:51 +00:00
/**
* Retrieve token
*
* @return string|null
*/
public function getToken()
{
return $this->_token;
}
/**
* Determine whether this is the last page of data
*
2015-01-19 20:45:05 +00:00
* @return bool
2013-06-19 09:13:51 +00:00
*/
public function isLast()
{
return (null === $this->_token);
}
/**
* Cast to string
*
* @return string
*/
public function __toString()
{
return "Page with token: " . $this->_token
. "\n and data: " . $this->_data;
}
}