ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
arJoinCollection Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for arJoinCollection:
+ Collaboration diagram for arJoinCollection:

Public Member Functions

 getSaveTableName (arStatement $arStatement)
 
 add (arStatement $arStatement)
 
 asSQLStatement (ilDBInterface $db)
 
 getJoins ()
 
- Public Member Functions inherited from arStatementCollection
 add (arStatement $statement)
 
 hasStatements ()
 
 asSQLStatement (ilDBInterface $db)
 
 setAr (ActiveRecord $ar)
 
 getAr ()
 
 setStatements (array $statements)
 
 getStatements ()
 

Protected Attributes

array $table_names = []
 
- Protected Attributes inherited from arStatementCollection
array $statements = []
 
ActiveRecord $ar = null
 

Additional Inherited Members

- Static Protected Attributes inherited from arStatementCollection
static array $cache = []
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class arJoinCollection

Author
Fabian Schmid fs@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch
Version
2.0.7

Definition at line 24 of file class.arJoinCollection.php.

Member Function Documentation

◆ add()

arJoinCollection::add ( arStatement  $arStatement)

Definition at line 45 of file class.arJoinCollection.php.

References ILIAS\UI\examples\Symbol\Glyph\Add\add(), getSaveTableName(), and arStatement\setTableNameAs().

45  : void
46  {
47  $arStatement->setTableNameAs($this->getSaveTableName($arStatement));
48  $this->table_names[] = $arStatement->getTableName();
49  parent::add($arStatement);
50  }
setTableNameAs(string $table_name_as)
getSaveTableName(arStatement $arStatement)
+ Here is the call graph for this function:

◆ asSQLStatement()

arJoinCollection::asSQLStatement ( ilDBInterface  $db)

Definition at line 52 of file class.arJoinCollection.php.

References arStatementCollection\getAr(), getJoins(), and arStatementCollection\hasStatements().

52  : string
53  {
54  $return = '';
55  if ($this->hasStatements()) {
56  foreach ($this->getJoins() as $arJoin) {
57  $return .= $arJoin->asSQLStatement($this->getAr(), $db);
58  }
59  }
60 
61  return $return;
62  }
+ Here is the call graph for this function:

◆ getJoins()

arJoinCollection::getJoins ( )
Returns
arJoin[]

Definition at line 67 of file class.arJoinCollection.php.

References arStatementCollection\$statements.

Referenced by asSQLStatement().

67  : array
68  {
69  return $this->statements;
70  }
+ Here is the caller graph for this function:

◆ getSaveTableName()

arJoinCollection::getSaveTableName ( arStatement  $arStatement)
Parameters
arJoin$arStatement

Definition at line 31 of file class.arJoinCollection.php.

Referenced by add().

31  : string
32  {
33  $tableName = $arStatement->getTableName();
34  if (in_array($tableName, $this->table_names, true)) {
35  $vals = array_count_values($this->table_names);
36  $next = $vals[$tableName] + 1;
37  $arStatement->setFullNames(true);
38  $arStatement->setIsMapped(true);
39 
40  return $tableName . '_' . $next;
41  }
42  return $tableName;
43  }
+ Here is the caller graph for this function:

Field Documentation

◆ $table_names

array arJoinCollection::$table_names = []
protected

Definition at line 26 of file class.arJoinCollection.php.


The documentation for this class was generated from the following file: