Skip to content
This repository
Browse code

Fluent API for PaginatedList

  • Loading branch information...
commit b53790eace9169196ecf2a998350fe4cabe02777 1 parent abbce15
Ingo Schommer authored August 28, 2012

Showing 1 changed file with 8 additions and 0 deletions. Show diff stats Hide diff stats

  1. 8  core/PaginatedList.php
8  core/PaginatedList.php
@@ -52,6 +52,7 @@ public function getPaginationGetVar() {
52 52
 	 */
53 53
 	public function setPaginationGetVar($var) {
54 54
 		$this->getVar = $var;
  55
+		return $this;
55 56
 	}
56 57
 
57 58
 	/**
@@ -70,6 +71,7 @@ public function getPageLength() {
70 71
 	 */
71 72
 	public function setPageLength($length) {
72 73
 		$this->pageLength = $length;
  74
+		return $this;
73 75
 	}
74 76
 
75 77
 	/**
@@ -79,6 +81,7 @@ public function setPageLength($length) {
79 81
 	 */
80 82
 	public function setCurrentPage($page) {
81 83
 		$this->pageStart = ($page - 1) * $this->pageLength;
  84
+		return $this;
82 85
 	}
83 86
 
84 87
 	/**
@@ -106,6 +109,7 @@ public function getPageStart() {
106 109
 	 */
107 110
 	public function setPageStart($start) {
108 111
 		$this->pageStart = $start;
  112
+		return $this;
109 113
 	}
110 114
 
111 115
 	/**
@@ -129,6 +133,7 @@ public function getTotalItems() {
129 133
 	 */
130 134
 	public function setTotalItems($items) {
131 135
 		$this->totalItems = $items;
  136
+		return $this;
132 137
 	}
133 138
 
134 139
 	/**
@@ -143,6 +148,7 @@ public function setPaginationFromQuery(SQLQuery $query) {
143 148
 			$this->setPageStart($limit['start']);
144 149
 			$this->setTotalItems($query->unlimitedRowCount());
145 150
 		}
  151
+		return $this;
146 152
 	}
147 153
 
148 154
 	/**
@@ -165,6 +171,7 @@ public function getLimitItems() {
165 171
 	 */
166 172
 	public function setLimitItems($limit) {
167 173
 		$this->limitItems = (bool) $limit;
  174
+		return $this;
168 175
 	}
169 176
 
170 177
 	/**
@@ -432,6 +439,7 @@ public function setPageLimits($pageStart, $pageLength, $totalSize) {
432 439
 		$this->setPageStart($pageStart);
433 440
 		$this->setPageLength($pageLength);
434 441
 		$this->setTotalSize($totalSize);
  442
+		return $this;
435 443
 	}
436 444
 
437 445
 }

0 notes on commit b53790e

Please sign in to comment.
Something went wrong with that request. Please try again.