ILIAS  trunk Revision v11.0_alpha-1866-gfa368f7776e
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator 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 $arStatement)
 
 hasStatements ()
 
 asSQLStatement (ilDBInterface $db)
 
 setAr (ActiveRecord $activeRecord)
 
 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 46 of file class.arJoinCollection.php.

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

46  : void
47  {
48  $arStatement->setTableNameAs($this->getSaveTableName($arStatement));
49  $this->table_names[] = $arStatement->getTableName();
50  parent::add($arStatement);
51  }
add()
description: > Example for rendring an add glyph.
Definition: add.php:41
setTableNameAs(string $table_name_as)
getSaveTableName(arStatement $arStatement)
+ Here is the call graph for this function:

◆ asSQLStatement()

arJoinCollection::asSQLStatement ( ilDBInterface  $db)

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

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

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

◆ getJoins()

arJoinCollection::getJoins ( )
Returns
arJoin[]

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

References arStatementCollection\$statements.

Referenced by asSQLStatement().

68  : array
69  {
70  return $this->statements;
71  }
+ 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: