web/lib/Zend/Service/Amazon/SimpleDb/Page.php
changeset 1230 68c69c656a2c
parent 807 877f952ae2bd
equal deleted inserted replaced
1229:5a6b6e770365 1230:68c69c656a2c
    13  * to license@zend.com so we can send you a copy immediately.
    13  * to license@zend.com so we can send you a copy immediately.
    14  *
    14  *
    15  * @category   Zend
    15  * @category   Zend
    16  * @package    Zend_Service_Amazon
    16  * @package    Zend_Service_Amazon
    17  * @subpackage SimpleDb
    17  * @subpackage SimpleDb
    18  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    18  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
    19  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    19  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    20  */
    20  */
    21 
    21 
    22 /**
    22 /**
    23  * @see Zend_Service_Amazon_Exception
    23  * @see Zend_Service_Amazon_Exception
    28  * The Custom Exception class that allows you to have access to the AWS Error Code.
    28  * The Custom Exception class that allows you to have access to the AWS Error Code.
    29  *
    29  *
    30  * @category   Zend
    30  * @category   Zend
    31  * @package    Zend_Service_Amazon
    31  * @package    Zend_Service_Amazon
    32  * @subpackage SimpleDb
    32  * @subpackage SimpleDb
    33  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    33  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
    34  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    34  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    35  */
    35  */
    36 class Zend_Service_Amazon_SimpleDb_Page
    36 class Zend_Service_Amazon_SimpleDb_Page
    37 {
    37 {
    38     /** @var string Page data */
    38     /**
       
    39      * Page data
       
    40      *
       
    41      * @var string
       
    42      */
    39     protected $_data;
    43     protected $_data;
    40 
    44 
    41     /** @var string|null Token identifying page */
    45     /**
       
    46      * Token identifying page
       
    47      *
       
    48      * @var string|null
       
    49      */
    42     protected $_token;
    50     protected $_token;
    43 
    51 
    44     /**
    52     /**
    45      * Constructor
    53      * Constructor
    46      *
    54      *
    47      * @param  string $data
    55      * @param string      $data
    48      * @param  string|null $token
    56      * @param string|null $token
    49      * @return void
       
    50      */
    57      */
    51     public function __construct($data, $token = null)
    58     public function __construct($data, $token = null)
    52     {
    59     {
    53         $this->_data  = $data;
    60         $this->setData($data);
    54         $this->_token = $token;
    61         $this->setToken($token);
       
    62     }
       
    63 
       
    64     /**
       
    65      * Set page data
       
    66      *
       
    67      * @param string $data
       
    68      */
       
    69     public function setData($data)
       
    70     {
       
    71         $this->_data = $data;
    55     }
    72     }
    56 
    73 
    57     /**
    74     /**
    58      * Retrieve page data
    75      * Retrieve page data
    59      *
    76      *
    60      * @return string
    77      * @return string
    61      */
    78      */
    62     public function getData()
    79     public function getData()
    63     {
    80     {
    64         return $this->_data;
    81         return $this->_data;
       
    82     }
       
    83 
       
    84     /**
       
    85      * Set token
       
    86      *
       
    87      * @param string|null $token
       
    88      */
       
    89     public function setToken($token)
       
    90     {
       
    91         $this->_token = (trim($token) === '') ? null : $token;
    65     }
    92     }
    66 
    93 
    67     /**
    94     /**
    68      * Retrieve token
    95      * Retrieve token
    69      *
    96      *
    75     }
   102     }
    76 
   103 
    77     /**
   104     /**
    78      * Determine whether this is the last page of data
   105      * Determine whether this is the last page of data
    79      *
   106      *
    80      * @return void
   107      * @return bool
    81      */
   108      */
    82     public function isLast()
   109     public function isLast()
    83     {
   110     {
    84         return (null === $this->_token);
   111         return (null === $this->_token);
    85     }
   112     }