summaryrefslogtreecommitdiff
path: root/framework/Data/SqlMap/DataMapper
diff options
context:
space:
mode:
authormikl <>2008-07-31 13:07:13 +0000
committermikl <>2008-07-31 13:07:13 +0000
commit5cb8bf3a2d0f7d7b9b0b5907a80aee85a8c6f2d9 (patch)
treefbc702049cf4acf280836dea42774cd39a983f17 /framework/Data/SqlMap/DataMapper
parente69594d31e5968cb3663cb6748bf1682cd914b5a (diff)
Fixed #893: Added page parameter to queryForPagedList()
Diffstat (limited to 'framework/Data/SqlMap/DataMapper')
-rw-r--r--framework/Data/SqlMap/DataMapper/TSqlMapPagedList.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/framework/Data/SqlMap/DataMapper/TSqlMapPagedList.php b/framework/Data/SqlMap/DataMapper/TSqlMapPagedList.php
index a52e9a39..b3a88653 100644
--- a/framework/Data/SqlMap/DataMapper/TSqlMapPagedList.php
+++ b/framework/Data/SqlMap/DataMapper/TSqlMapPagedList.php
@@ -41,12 +41,13 @@ class TSqlMapPagedList extends TPagedList
* @param mixed query parameters
* @param int page size
* @param mixed delegate for each data row retrieved.
+ * @param int number of page to fetch on initialization
*/
- public function __construct(IMappedStatement $statement,$parameter, $pageSize, $delegate=null)
+ public function __construct(IMappedStatement $statement,$parameter, $pageSize, $delegate=null, $page=0)
{
parent::__construct();
parent::setCustomPaging(true);
- $this->initialize($statement,$parameter, $pageSize);
+ $this->initialize($statement,$parameter, $pageSize, $page);
$this->_delegate=$delegate;
}
@@ -55,14 +56,15 @@ class TSqlMapPagedList extends TPagedList
* @param IMappedStatement SqlMap statement.
* @param mixed query parameters
* @param int page size.
+ * @param int number of page.
*/
- protected function initialize($statement, $parameter, $pageSize)
+ protected function initialize($statement, $parameter, $pageSize, $page)
{
$this->_statement = $statement;
$this->_parameter = $parameter;
$this->setPageSize($pageSize);
$this->attachEventHandler('OnFetchData', array($this, 'fetchDataFromStatement'));
- $this->gotoPage(0);
+ $this->gotoPage($page);
}
/**