Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Commit 4134b1b

Browse files
committed
Fixes #1 - isLast not working as expected in Zend_Service_Amazon_SimpleDb_Page
1 parent ae63b4d commit 4134b1b

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

library/Zend/Service/Amazon/SimpleDb.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,6 @@ public function listDomains($maxNumberOfDomains = 100, $nextToken = null)
307307

308308
$nextTokenNode = $response->getSimpleXMLDocument()->ListDomainsResult->NextToken;
309309
$nextToken = (string)$nextTokenNode;
310-
$nextToken = (trim($nextToken) === '') ? null : $nextToken;
311310

312311
return new Zend_Service_Amazon_SimpleDb_Page($data, $nextToken);
313312
}

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

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,18 @@ class Zend_Service_Amazon_SimpleDb_Page
5050
*/
5151
public function __construct($data, $token = null)
5252
{
53-
$this->_data = $data;
54-
$this->_token = $token;
53+
$this->setData($data);
54+
$this->setToken($token);
55+
}
56+
57+
/**
58+
* Set page data
59+
*
60+
* @param string $data
61+
*/
62+
public function setData($data)
63+
{
64+
$this->_data = $data;
5565
}
5666

5767
/**
@@ -64,6 +74,16 @@ public function getData()
6474
return $this->_data;
6575
}
6676

77+
/**
78+
* Set token
79+
*
80+
* @param string|null $token
81+
*/
82+
public function setToken($token)
83+
{
84+
$this->_token = (trim($token) === '') ? null : $token;
85+
}
86+
6787
/**
6888
* Retrieve token
6989
*

0 commit comments

Comments
 (0)