ILIAS
release_5-0 Revision 5.0.0-1144-gc4397b1f870
◀ ilDoc Overview
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
+
Data Fields
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
$
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
+
Files
File List
+
Globals
+
All
$
(
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
+
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
o
p
r
s
t
u
v
w
x
+
Variables
$
(
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Modules
Pages
class.arWhere.php
Go to the documentation of this file.
1
<?php
2
require_once(dirname(__FILE__) .
'/../Statement/class.arStatement.php'
);
3
10
class
arWhere
extends
arStatement
{
11
12
const
TYPE_STRING
= 1;
13
const
TYPE_REGULAR
= 2;
17
protected
$type
= self::TYPE_REGULAR;
21
protected
$fieldname
=
''
;
25
protected
$value
;
29
protected
$operator =
'='
;
33
protected
$statement
=
''
;
37
protected
$link
=
'AND'
;
38
39
48
public
function
asSQLStatement
(
ActiveRecord
$ar) {
49
if
($this->
getType
() == self::TYPE_REGULAR) {
50
$arField = $ar->
getArFieldList
()->getFieldByName($this->
getFieldname
());
51
if
($arField instanceof
arField
) {
52
$type
= $arField->getFieldType();
53
$statement
= $ar->
getConnectorContainerName
() .
'.'
. $this->
getFieldname
();
54
}
else
{
55
$statement
= $this->
getFieldname
();
56
}
57
58
if
(is_array($this->
getValue
())) {
59
if
(in_array($this->
getOperator
(), array(
'IN'
,
'NOT IN'
,
'NOTIN'
))) {
60
$statement
.=
' '
. $this->
getOperator
() .
' ('
;
61
}
else
{
62
$statement
.=
' IN ('
;
63
}
64
$values = array();
65
foreach
($this->
getValue
() as
$value
) {
66
$values[] = $ar->
getArConnector
()->quote($value,
$type
);
67
}
68
$statement
.= implode(
', '
, $values);
69
$statement
.=
')'
;
70
}
else
{
71
if
($this->
getValue
() === NULL) {
72
$operator =
'IS'
;
73
if
(in_array($this->
getOperator
(), array(
'IS'
,
'IS NOT'
))) {
74
$operator = $this->
getOperator
();
75
}
76
$this->
setOperator
($operator);
77
}
78
$statement
.=
' '
. $this->
getOperator
();
79
$statement
.=
' '
. $ar->
getArConnector
()->quote($this->
getValue
(),
$type
);
80
}
81
$this->
setStatement
(
$statement
);
82
}
83
84
return
$this->
getStatement
();
85
}
86
87
91
public
function
setFieldname
(
$fieldname
) {
92
$this->fieldname =
$fieldname
;
93
}
94
95
99
public
function
getFieldname
() {
100
return
$this->fieldname
;
101
}
102
103
107
public
function
setOperator
($operator) {
108
$this->
operator
= $operator;
109
}
110
111
115
public
function
getOperator
() {
116
return
$this->operator;
117
}
118
119
123
public
function
setValue
(
$value
) {
124
$this->value =
$value
;
125
}
126
127
131
public
function
getValue
() {
132
return
$this->value
;
133
}
134
135
139
public
function
setType
(
$type
) {
140
$this->type =
$type
;
141
}
142
143
147
public
function
getType
() {
148
return
$this->type
;
149
}
150
151
155
public
function
setStatement
(
$statement
) {
156
$this->statement =
$statement
;
157
}
158
159
163
public
function
getStatement
() {
164
return
$this->statement
;
165
}
166
167
171
public
function
setLink
(
$link
) {
172
$this->link =
$link
;
173
}
174
175
179
public
function
getLink
() {
180
return
$this->link
;
181
}
182
}
183
184
?>
arField
Class arField.
Definition:
class.arField.php:10
arWhere\$value
$value
Definition:
class.arWhere.php:25
arWhere\getStatement
getStatement()
Definition:
class.arWhere.php:163
arWhere\setFieldname
setFieldname($fieldname)
Definition:
class.arWhere.php:91
ActiveRecord\getArConnector
getArConnector()
Definition:
class.ActiveRecord.php:47
ActiveRecord
Class ActiveRecord.
Definition:
class.ActiveRecord.php:23
arWhere
Class arWhere.
Definition:
class.arWhere.php:10
arWhere\setStatement
setStatement($statement)
Definition:
class.arWhere.php:155
arWhere\$fieldname
$fieldname
Definition:
class.arWhere.php:21
arWhere\getType
getType()
Definition:
class.arWhere.php:147
arWhere\getLink
getLink()
Definition:
class.arWhere.php:179
arWhere\asSQLStatement
asSQLStatement(ActiveRecord $ar)
Build WHERE Statement
Definition:
class.arWhere.php:48
arStatement
Class arStatement.
Definition:
class.arStatement.php:10
arWhere\TYPE_REGULAR
const TYPE_REGULAR
Definition:
class.arWhere.php:13
arWhere\$statement
$statement
Definition:
class.arWhere.php:33
arWhere\setLink
setLink($link)
Definition:
class.arWhere.php:171
ActiveRecord\getConnectorContainerName
getConnectorContainerName()
Definition:
class.ActiveRecord.php:74
arWhere\setType
setType($type)
Definition:
class.arWhere.php:139
arWhere\$type
$type
Definition:
class.arWhere.php:17
arWhere\getOperator
getOperator()
Definition:
class.arWhere.php:115
ActiveRecord\getArFieldList
getArFieldList()
Definition:
class.ActiveRecord.php:56
arWhere\getFieldname
getFieldname()
Definition:
class.arWhere.php:99
arWhere\getValue
getValue()
Definition:
class.arWhere.php:131
arWhere\$link
$link
Definition:
class.arWhere.php:37
arWhere\setValue
setValue($value)
Definition:
class.arWhere.php:123
arWhere\TYPE_STRING
const TYPE_STRING
Definition:
class.arWhere.php:12
arWhere\setOperator
setOperator($operator)
Definition:
class.arWhere.php:107
Services
ActiveRecord
Connector
Where
class.arWhere.php
Generated on Mon Apr 14 2025 19:00:41 for ILIAS by
1.8.13 (using
Doxyfile
)