XpressEngine Core
1.11.2
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Pages
classes
xml
xmlquery
tags
navigation
LimitTag.class.php
Go to the documentation of this file.
1
<?php
2
/* Copyright (C) NAVER <http://www.navercorp.com> */
3
11
class
LimitTag
12
{
13
18
var
$arguments
;
19
24
var
$page
;
25
30
var
$page_count
;
31
36
var
$list_count
;
37
42
var
$offset
;
43
49
function
__construct
($index)
50
{
51
if
($index->page && $index->page->attrs && $index->page_count && $index->page_count->attrs)
52
{
53
if
(!isset($index->page->attrs->default))
54
$index->page->attrs->default = 1;
55
if
(!isset($index->page_count->attrs->default))
56
$index->page_count->attrs->default = 10;
57
$this->
page
=
new
QueryArgument
($index->page);
58
$this->page_count =
new
QueryArgument
($index->page_count);
59
$this->arguments[] =
$this->page
;
60
$this->arguments[] =
$this->page_count
;
61
}
62
63
if
(!isset($index->list_count->attrs->default))
64
$index->list_count->attrs->default = 0;
65
$this->list_count =
new
QueryArgument
($index->list_count);
66
$this->arguments[] =
$this->list_count
;
67
68
if
(isset($index->offset) && isset($index->offset->attrs))
69
{
70
$this->offset =
new
QueryArgument
($index->offset);
71
$this->arguments[] =
$this->offset
;
72
}
73
}
74
75
function
toString
()
76
{
77
if
($this->
page
)
78
{
79
return
sprintf(
'new Limit(${\'%s_argument\'}, ${\'%s_argument\'}, ${\'%s_argument\'})'
, $this->list_count->getArgumentName(), $this->
page
->getArgumentName(), $this->page_count->getArgumentName());
80
}
81
elseif($this->offset)
82
{
83
return
sprintf(
'new Limit(${\'%s_argument\'}, NULL, NULL, ${\'%s_argument\'})'
, $this->list_count->getArgumentName(), $this->offset->getArgumentName());
84
}
85
else
86
{
87
return
sprintf(
'new Limit(${\'%s_argument\'})'
, $this->list_count->getArgumentName());
88
}
89
}
90
91
function
getArguments
()
92
{
93
return
$this->arguments
;
94
}
95
96
}
97
/* End of file LimitTag.class.php */
98
/* Location: ./classes/xml/xmlquery/tags/navigation/LimitTag.class.php */
page
high class of the module page
Definition:
page.class.php:8
LimitTag\getArguments
getArguments()
Definition:
LimitTag.class.php:91
LimitTag
Definition:
LimitTag.class.php:11
LimitTag\$offset
$offset
Definition:
LimitTag.class.php:42
LimitTag\__construct
__construct($index)
Definition:
LimitTag.class.php:49
LimitTag\$list_count
$list_count
Definition:
LimitTag.class.php:36
LimitTag\$page_count
$page_count
Definition:
LimitTag.class.php:30
LimitTag\toString
toString()
Definition:
LimitTag.class.php:75
LimitTag\$arguments
$arguments
Definition:
LimitTag.class.php:18
QueryArgument
Definition:
QueryArgument.class.php:10
LimitTag\$page
$page
Definition:
LimitTag.class.php:24
Generated on Tue Dec 18 2018 17:04:25 for XpressEngine Core by
1.8.5