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
db
queryparts
condition
ConditionWithArgument.class.php
Go to the documentation of this file.
1
<?php
2
/* Copyright (C) NAVER <http://www.navercorp.com> */
3
9
class
ConditionWithArgument
extends
Condition
10
{
11
20
function
__construct
(
$column_name
,
$argument
,
$operation
,
$pipe
=
""
)
21
{
22
if
(
$argument
=== null)
23
{
24
$this->_show =
false
;
25
return
;
26
}
27
parent::__construct(
$column_name
,
$argument
,
$operation
,
$pipe
);
28
$this->_value =
$argument
->getValue();
29
}
30
31
function
getArgument
()
32
{
33
if
(!$this->
show
())
34
return
;
35
return
$this->argument
;
36
}
37
42
function
toStringWithoutValue
()
43
{
44
$value = $this->argument->getUnescapedValue();
45
46
if
(is_array($value))
47
{
48
$q =
''
;
49
foreach
($value as $v)
50
{
51
$q .=
'?,'
;
52
}
53
if
($q !==
''
)
54
{
55
$q = substr($q, 0, -1);
56
}
57
$q =
'('
. $q .
')'
;
58
}
59
else
60
{
61
// Prepared statements: column names should not be sent as query arguments, but instead concatenated to query string
62
if
($this->argument->isColumnName())
63
{
64
$q = $value;
65
}
66
else
67
{
68
$q =
'?'
;
69
}
70
}
71
return
$this->pipe .
' '
. $this->
getConditionPart
($q);
72
}
73
77
function
show
()
78
{
79
if
(!isset($this->_show))
80
{
81
if
(!$this->argument->isValid())
82
{
83
$this->_show =
false
;
84
}
85
if
($this->_value ===
'\'
\
''
)
86
{
87
$this->_show =
false
;
88
}
89
if
(!isset($this->_show))
90
{
91
return
parent::show();
92
}
93
}
94
return
$this->_show
;
95
}
96
97
}
98
/* End of file ConditionWithArgument.class.php */
99
/* Location: ./classes/db/queryparts/condition/ConditionWithArgument.class.php */
Condition\$_show
$_show
Definition:
Condition.class.php:33
ConditionWithArgument\__construct
__construct($column_name, $argument, $operation, $pipe="")
Definition:
ConditionWithArgument.class.php:20
ConditionWithArgument\getArgument
getArgument()
Definition:
ConditionWithArgument.class.php:31
ConditionWithArgument\show
show()
Definition:
ConditionWithArgument.class.php:77
Condition\$operation
$operation
Definition:
Condition.class.php:25
ConditionWithArgument
Definition:
ConditionWithArgument.class.php:9
Condition
Definition:
Condition.class.php:9
Condition\$argument
$argument
Definition:
Condition.class.php:17
ConditionWithArgument\toStringWithoutValue
toStringWithoutValue()
Definition:
ConditionWithArgument.class.php:42
Condition\$column_name
$column_name
Definition:
Condition.class.php:16
Condition\$pipe
$pipe
Definition:
Condition.class.php:31
Condition\getConditionPart
getConditionPart($value)
Definition:
Condition.class.php:186
Generated on Tue Dec 18 2018 17:04:25 for XpressEngine Core by
1.8.5