Skip to content
This repository has been archived by the owner on May 16, 2018. It is now read-only.

Commit

Permalink
Fixes #1 - isLast not working as expected in Zend_Service_Amazon_Simp…
Browse files Browse the repository at this point in the history
…leDb_Page
  • Loading branch information
froschdesign committed Nov 30, 2014
1 parent ae63b4d commit 4134b1b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
1 change: 0 additions & 1 deletion library/Zend/Service/Amazon/SimpleDb.php
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,6 @@ public function listDomains($maxNumberOfDomains = 100, $nextToken = null)

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

return new Zend_Service_Amazon_SimpleDb_Page($data, $nextToken);
}
Expand Down
24 changes: 22 additions & 2 deletions library/Zend/Service/Amazon/SimpleDb/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,18 @@ class Zend_Service_Amazon_SimpleDb_Page
*/
public function __construct($data, $token = null)
{
$this->_data = $data;
$this->_token = $token;
$this->setData($data);
$this->setToken($token);
}

/**
* Set page data
*
* @param string $data
*/
public function setData($data)
{
$this->_data = $data;
}

/**
Expand All @@ -64,6 +74,16 @@ public function getData()
return $this->_data;
}

/**
* Set token
*
* @param string|null $token
*/
public function setToken($token)
{
$this->_token = (trim($token) === '') ? null : $token;
}

/**
* Retrieve token
*
Expand Down

0 comments on commit 4134b1b

Please sign in to comment.