ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.arJoin.php
Go to the documentation of this file.
1<?php
2require_once(dirname(__FILE__) . '/../Statement/class.arStatement.php');
3
11class arJoin extends arStatement {
12
14 const TYPE_LEFT = 'LEFT';
15 const TYPE_RIGHT = 'RIGHT';
16 const TYPE_INNER = 'INNER';
24 protected $table_name = '';
28 protected $fields = array( '*' );
32 protected $operator = '=';
36 protected $on_first_field = '';
40 protected $on_second_field = '';
44 protected $full_names = false;
48 protected $both_external = false;
52 protected $is_mapped = false;
53
54
60 protected function asStatementText(ActiveRecord $ar, $as = ' AS ') {
61 $return = ' ' . $this->getType() . ' ';
62 $return .= ' JOIN ' . $this->getTableName() . $as . $this->getTableNameAs();
63 if ($this->getBothExternal()) {
64 $return .= ' ON ' . $this->getOnFirstField() . ' ' . $this->getOperator() . ' ';
65 } else {
66 $return .= ' ON ' . $ar->getConnectorContainerName() . '.' . $this->getOnFirstField() . ' ' . $this->getOperator() . ' ';
67 }
68 $return .= $this->getTableNameAs() . '.' . $this->getOnSecondField();
69
70 return $return;
71 }
72
73
79 public function asSQLStatement(ActiveRecord $ar) {
80 return $this->asStatementText($ar, ' AS ');
81 }
82
83
88 public function asORACLEStatement(ActiveRecord $ar) {
89 return $this->asStatementText($ar, ' ');
90 }
91
92
93 public function setLeft() {
94 $this->setType(self::TYPE_LEFT);
95 }
96
97
98 public function setRght() {
99 $this->setType(self::TYPE_RIGHT);
100 }
101
102
103 public function setInner() {
104 $this->setType(self::TYPE_INNER);
105 }
106
107
111 public function setFields($fields) {
112 $this->fields = $fields;
113 }
114
115
119 public function getFields() {
120 return $this->fields;
121 }
122
123
128 $this->on_first_field = $on_first_field;
129 }
130
131
135 public function getOnFirstField() {
137 }
138
139
144 $this->on_second_field = $on_second_field;
145 }
146
147
151 public function getOnSecondField() {
153 }
154
155
159 public function setOperator($operator) {
160 $this->operator = $operator;
161 }
162
163
167 public function getOperator() {
168 return $this->operator;
169 }
170
171
175 public function setTableName($table_name) {
176 $this->table_name = $table_name;
177 }
178
179
183 public function getTableName() {
184 return $this->table_name;
185 }
186
187
191 public function setType($type) {
192 $this->type = $type;
193 }
194
195
199 public function getType() {
200 return $this->type;
201 }
202
203
208 $this->both_external = $both_external;
209 }
210
211
215 public function getBothExternal() {
217 }
218
219
223 public function setFullNames($full_names) {
224 $this->full_names = $full_names;
225 }
226
227
231 public function getFullNames() {
232 return $this->full_names;
233 }
234
235
239 public function isIsMapped() {
240 return $this->is_mapped;
241 }
242
243
247 public function setIsMapped($is_mapped) {
248 $this->is_mapped = $is_mapped;
249 }
250}
251
252?>
Class ActiveRecord.
An exception for terminatinating execution or to throw for unit testing.
Class arJoin.
setFields($fields)
const TYPE_INNER
asSQLStatement(ActiveRecord $ar)
getOnFirstField()
$on_second_field
setIsMapped($is_mapped)
asStatementText(ActiveRecord $ar, $as=' AS ')
const TYPE_NORMAL
setOperator($operator)
getBothExternal()
setBothExternal($both_external)
setFullNames($full_names)
getFullNames()
const TYPE_RIGHT
getTableName()
setTableName($table_name)
asORACLEStatement(ActiveRecord $ar)
setOnSecondField($on_second_field)
const TYPE_LEFT
getOnSecondField()
setOnFirstField($on_first_field)
setType($type)
Class arStatement.
$errors fields
Definition: imgupload.php:52