ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.arJoinCollection.php
Go to the documentation of this file.
1 <?php
2 require_once(dirname(__FILE__) . '/../Statement/class.arStatementCollection.php');
3 require_once('class.arJoin.php');
4 
12 
16  protected $table_names = array();
17 
18 
24  public function getSaveTableName(arJoin $statement) {
25  $table_name = $statement->getTableName();
26  if (in_array($table_name, $this->table_names)) {
27  $vals = array_count_values($this->table_names);
28  $next = $vals[$table_name] + 1;
29  $statement->setFullNames(true);
30  $statement->setIsMapped(true);
31 
32  return $table_name . '_' . $next;
33  } else {
34  return $table_name;
35  }
36  }
37 
38 
42  public function add(arStatement $statement) {
43  $statement->setTableNameAs($this->getSaveTableName($statement));
44  $this->table_names[] = $statement->getTableName();
45  parent::add($statement);
46  }
47 
48 
52  public function asSQLStatement() {
53  $return = '';
54  if ($this->hasStatements()) {
55  foreach ($this->getJoins() as $join) {
56  $return .= $join->asSQLStatement($this->getAr());
57  }
58  }
59 
60  return $return;
61  }
62 
63 
67  public function asORACLEStatement() {
68  $return = '';
69  if ($this->hasStatements()) {
70  foreach ($this->getJoins() as $join) {
71  $return .= $join->asORACLEStatement($this->getAr());
72  }
73  }
74 
75  return $return;
76  }
77 
78 
82  public function getJoins() {
83  return $this->statements;
84  }
85 }
86 
87 ?>
Class arStatementCollection.
Class arJoin.
setTableNameAs($table_name_as)
setIsMapped($is_mapped)
getTableName()
Class arStatement.
setFullNames($full_names)
add()
Definition: add.php:2
getSaveTableName(arJoin $statement)
Create styles array
The data for the language used.
Class arJoinCollection.
add(arStatement $statement)