XpressEngine Core  1.11.2
 All Classes Namespaces Files Functions Variables Pages
Limit.class.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) NAVER <http://www.navercorp.com> */
3 
9 class Limit
10 {
11 
16  var $start;
17 
23 
29 
34  var $page;
35 
44  function __construct($list_count, $page = NULL, $page_count = NULL, $offset = NULL)
45  {
46  $this->list_count = $list_count;
47  if($page)
48  {
49  $list_count_value = $list_count->getValue();
50  $page_value = $page->getValue();
51  $this->start = ($page_value - 1) * $list_count_value;
52  $this->page_count = $page_count;
53  $this->page = $page;
54  }
55  elseif($offset)
56  {
57  $this->start = $offset->getValue();
58  }
59  }
60 
65  function isPageHandler()
66  {
67  if($this->page)
68  {
69  return true;
70  }
71  else
72  {
73  return false;
74  }
75  }
76 
77  function getOffset()
78  {
79  return $this->start;
80  }
81 
82  function getLimit()
83  {
84  return $this->list_count->getValue();
85  }
86 
87  function toString()
88  {
89  if($this->page || $this->start)
90  {
91  return $this->start . ' , ' . $this->list_count->getValue();
92  }
93  else
94  {
95  return $this->list_count->getValue();
96  }
97  }
98 
99 }
100 /* End of file Limit.class.php */
101 /* Location: ./classes/db/limit/Limit.class.php */
toString()
Definition: Limit.class.php:87
high class of the module page
Definition: page.class.php:8
isPageHandler()
Definition: Limit.class.php:65
getLimit()
Definition: Limit.class.php:82
__construct($list_count, $page=NULL, $page_count=NULL, $offset=NULL)
Definition: Limit.class.php:44
getOffset()
Definition: Limit.class.php:77