Changed PagerAction, search and order methods of Model, #16
git-svn-id: svn+ssh://code.netmonsters.ru/svn/majestic/branches/evo@148 4cb57b5f-5bbd-dd11-951b-001d605cbbc5
This commit is contained in:
@ -11,22 +11,22 @@
|
||||
|
||||
class PagerAction extends Action
|
||||
{
|
||||
public $page;
|
||||
public $last_page;
|
||||
public $page = 1;
|
||||
public $last_page = 1;
|
||||
protected $offset = 0;
|
||||
protected $count = 0;
|
||||
protected $limit;
|
||||
|
||||
public function __construct($count, $limit = 20)
|
||||
public function __construct($limit = 20)
|
||||
{
|
||||
$this->count = $count;
|
||||
$this->limit = $limit;
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
protected function execute()
|
||||
protected function execute() {}
|
||||
|
||||
public function setCount($count)
|
||||
{
|
||||
$this->last_page = ceil($this->count / $this->limit);
|
||||
$this->last_page = ceil($count / $this->limit);
|
||||
if (Env::Get('p') == 'last') {
|
||||
$page = $this->last_page;
|
||||
} else {
|
||||
@ -38,12 +38,12 @@ class PagerAction extends Action
|
||||
|
||||
public function getOffset()
|
||||
{
|
||||
return $this->offset;
|
||||
return (int) $this->offset;
|
||||
}
|
||||
|
||||
public function getLimit()
|
||||
{
|
||||
return $this->limit;
|
||||
return (int) $this->limit;
|
||||
}
|
||||
|
||||
protected function getTemplate()
|
||||
|
Reference in New Issue
Block a user