Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fluent API for PaginatedList

  • Loading branch information...
commit b53790eace9169196ecf2a998350fe4cabe02777 1 parent abbce15
@chillu chillu authored
Showing with 8 additions and 0 deletions.
  1. +8 −0 core/PaginatedList.php
View
8 core/PaginatedList.php
@@ -52,6 +52,7 @@ public function getPaginationGetVar() {
*/
public function setPaginationGetVar($var) {
$this->getVar = $var;
+ return $this;
}
/**
@@ -70,6 +71,7 @@ public function getPageLength() {
*/
public function setPageLength($length) {
$this->pageLength = $length;
+ return $this;
}
/**
@@ -79,6 +81,7 @@ public function setPageLength($length) {
*/
public function setCurrentPage($page) {
$this->pageStart = ($page - 1) * $this->pageLength;
+ return $this;
}
/**
@@ -106,6 +109,7 @@ public function getPageStart() {
*/
public function setPageStart($start) {
$this->pageStart = $start;
+ return $this;
}
/**
@@ -129,6 +133,7 @@ public function getTotalItems() {
*/
public function setTotalItems($items) {
$this->totalItems = $items;
+ return $this;
}
/**
@@ -143,6 +148,7 @@ public function setPaginationFromQuery(SQLQuery $query) {
$this->setPageStart($limit['start']);
$this->setTotalItems($query->unlimitedRowCount());
}
+ return $this;
}
/**
@@ -165,6 +171,7 @@ public function getLimitItems() {
*/
public function setLimitItems($limit) {
$this->limitItems = (bool) $limit;
+ return $this;
}
/**
@@ -432,6 +439,7 @@ public function setPageLimits($pageStart, $pageLength, $totalSize) {
$this->setPageStart($pageStart);
$this->setPageLength($pageLength);
$this->setTotalSize($totalSize);
+ return $this;
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.