Example #1
0
 public function setStorageHint($hint)
 {
     constraint_mustBeInteger($hint);
     constraint_mustBeGreaterThan($hint, Datastore::HINT_START);
     constraint_mustBeLessThan($hint, Datastore::HINT_END);
     $this->storageHint = $hint;
 }
Example #2
0
 public function __construct($page, $resultsThisPage, $resultsPerPage, $totalResults, $pageKey = 'page')
 {
     constraint_mustBeInteger($page);
     constraint_mustBeInteger($resultsThisPage);
     constraint_mustBeInteger($resultsPerPage);
     constraint_mustBeInteger($totalResults);
     $this->page = $page;
     $this->resultsThisPage = $resultsThisPage;
     $this->resultsPerPage = $resultsPerPage;
     $this->totalResults = $totalResults;
     $this->pageKey = $pageKey;
     $this->totalPages = $totalResults / $resultsPerPage;
     if ($totalResults % $resultsPerPage > 0) {
         $this->totalPages++;
     }
 }