fix query "limit" tag in other cases than page select

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0-DB@8409 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
mosmartin 2011-05-30 13:20:28 +00:00
parent 64d268ab6b
commit 68f068cf88
3 changed files with 22 additions and 15 deletions

View file

@ -5,20 +5,23 @@
var $page_count;
var $page;
function Limit($page, $list_count, $page_count){
$this->start = ($page-1)*$list_count;
function Limit($list_count, $page= NULL, $page_count= NULL){
$this->list_count = $list_count;
$this->page_count = $page_count;
$this->page = $page;
if ($page){
$this->start = ($page-1)*$list_count;
$this->page_count = $page_count;
$this->page = $page;
}
}
function isPageHandler(){//in case you choose to use query limit in other cases than page select
return true;
if ($this->page)return true;
else return false;
}
function toString(){
return $this->start . ' , ' . $this->list_count;
if ($this->page) return $this->start . ' , ' . $this->list_count;
else return $this->list_count;
}
}
?>