ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
arJoin 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 arJoin:
+ Collaboration diagram for arJoin:

Public Member Functions

 asSQLStatement (ActiveRecord $activeRecord, ilDBInterface $db)
 
 setLeft ()
 
 setRght ()
 
 setInner ()
 
 setFields (array $fields)
 
 getFields ()
 
 setOnFirstField (string $on_first_field)
 
 getOnFirstField ()
 
 setOnSecondField (string $on_second_field)
 
 getOnSecondField ()
 
 setOperator (string $operator)
 
 getOperator ()
 
 setTableName (string $table_name)
 
 getTableName ()
 
 setType (string $type)
 
 getType ()
 
 setBothExternal (bool $both_external)
 
 getBothExternal ()
 
 setFullNames (bool $full_names)
 
 getFullNames ()
 
 isIsMapped ()
 
 setIsMapped (bool $is_mapped)
 
- Public Member Functions inherited from arStatement
 asSQLStatement (ActiveRecord $activeRecord, ilDBInterface $db)
 
 getTableNameAs ()
 
 setTableNameAs (string $table_name_as)
 

Data Fields

const TYPE_NORMAL = self::TYPE_INNER
 
const TYPE_LEFT = 'LEFT'
 
const TYPE_RIGHT = 'RIGHT'
 
const TYPE_INNER = 'INNER'
 
const AS_TEXT = ' AS '
 

Protected Member Functions

 asStatementText (ActiveRecord $activeRecord, ilDBInterface $db, string $as=' AS ')
 
- Protected Member Functions inherited from arStatement
 wrapFields (array $fields, ilDBInterface $db)
 
 wrapField (string $field, ilDBInterface $db)
 

Protected Attributes

string $type = self::TYPE_NORMAL
 
string $table_name = ''
 
array $fields = ['*']
 
string $operator='='
 
string $on_first_field = ''
 
string $on_second_field = ''
 
bool $full_names = false
 
bool $both_external = false
 
bool $is_mapped = false
 
- Protected Attributes inherited from arStatement
string $table_name_as = ''
 

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 arJoin

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

Definition at line 25 of file class.arJoin.php.

Member Function Documentation

◆ asSQLStatement()

arJoin::asSQLStatement ( ActiveRecord  $activeRecord,
ilDBInterface  $db 
)

Definition at line 64 of file class.arJoin.php.

References asStatementText().

64  : string
65  {
66  return $this->asStatementText($activeRecord, $db, self::AS_TEXT);
67  }
asStatementText(ActiveRecord $activeRecord, ilDBInterface $db, string $as=' AS ')
+ Here is the call graph for this function:

◆ asStatementText()

arJoin::asStatementText ( ActiveRecord  $activeRecord,
ilDBInterface  $db,
string  $as = ' AS ' 
)
protected

Definition at line 42 of file class.arJoin.php.

References getBothExternal(), ActiveRecord\getConnectorContainerName(), getOnFirstField(), getOnSecondField(), getOperator(), getTableName(), arStatement\getTableNameAs(), getType(), and arStatement\wrapField().

Referenced by asSQLStatement().

42  : string
43  {
44  $return = ' ' . $this->getType() . ' ';
45  $return .= ' JOIN ' . $this->getTableName() . $as . $this->getTableNameAs();
46  if ($this->getBothExternal()) {
47  $return .= ' ON ' . $this->wrapField($this->getOnFirstField(), $db) . ' ' . $this->getOperator() . ' ';
48  } else {
49  $return .= ' ON '
50  . $this->wrapField(
51  $activeRecord->getConnectorContainerName() . '.' . $this->getOnFirstField(),
52  $db
53  )
54  . ' ' . $this->getOperator() . ' ';
55  }
56 
57  return $return . $this->wrapField(
58  $this->getTableNameAs() . '.' .
59  $this->getOnSecondField(),
60  $db
61  );
62  }
getTableName()
wrapField(string $field, ilDBInterface $db)
getBothExternal()
getConnectorContainerName()
Return the Name of your Connector Table
getOnFirstField()
getOnSecondField()
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getBothExternal()

arJoin::getBothExternal ( )

Definition at line 155 of file class.arJoin.php.

References $both_external.

Referenced by asStatementText().

155  : bool
156  {
157  return $this->both_external;
158  }
bool $both_external
+ Here is the caller graph for this function:

◆ getFields()

arJoin::getFields ( )
Returns
mixed[]

Definition at line 95 of file class.arJoin.php.

References $fields.

95  : array
96  {
97  return $this->fields;
98  }
array $fields

◆ getFullNames()

arJoin::getFullNames ( )

Definition at line 165 of file class.arJoin.php.

References $full_names.

165  : bool
166  {
167  return $this->full_names;
168  }
bool $full_names

◆ getOnFirstField()

arJoin::getOnFirstField ( )

Definition at line 105 of file class.arJoin.php.

References $on_first_field.

Referenced by asStatementText().

105  : string
106  {
107  return $this->on_first_field;
108  }
string $on_first_field
+ Here is the caller graph for this function:

◆ getOnSecondField()

arJoin::getOnSecondField ( )

Definition at line 115 of file class.arJoin.php.

References $on_second_field.

Referenced by asStatementText().

115  : string
116  {
117  return $this->on_second_field;
118  }
string $on_second_field
+ Here is the caller graph for this function:

◆ getOperator()

arJoin::getOperator ( )

Definition at line 125 of file class.arJoin.php.

Referenced by asStatementText().

125  : string
126  {
127  return $this->operator;
128  }
+ Here is the caller graph for this function:

◆ getTableName()

arJoin::getTableName ( )

Definition at line 135 of file class.arJoin.php.

References $table_name.

Referenced by asStatementText().

135  : string
136  {
137  return $this->table_name;
138  }
string $table_name
+ Here is the caller graph for this function:

◆ getType()

arJoin::getType ( )

Definition at line 145 of file class.arJoin.php.

References $type.

Referenced by asStatementText().

145  : string
146  {
147  return $this->type;
148  }
string $type
+ Here is the caller graph for this function:

◆ isIsMapped()

arJoin::isIsMapped ( )

Definition at line 170 of file class.arJoin.php.

References $is_mapped.

170  : bool
171  {
172  return $this->is_mapped;
173  }
bool $is_mapped

◆ setBothExternal()

arJoin::setBothExternal ( bool  $both_external)

Definition at line 150 of file class.arJoin.php.

References $both_external.

150  : void
151  {
152  $this->both_external = $both_external;
153  }
bool $both_external

◆ setFields()

arJoin::setFields ( array  $fields)
Parameters
mixed[]$fields

Definition at line 87 of file class.arJoin.php.

References $fields.

87  : void
88  {
89  $this->fields = $fields;
90  }
array $fields

◆ setFullNames()

arJoin::setFullNames ( bool  $full_names)

Definition at line 160 of file class.arJoin.php.

References $full_names.

160  : void
161  {
162  $this->full_names = $full_names;
163  }
bool $full_names

◆ setInner()

arJoin::setInner ( )

Definition at line 79 of file class.arJoin.php.

References setType().

79  : void
80  {
81  $this->setType(self::TYPE_INNER);
82  }
setType(string $type)
+ Here is the call graph for this function:

◆ setIsMapped()

arJoin::setIsMapped ( bool  $is_mapped)

Definition at line 175 of file class.arJoin.php.

References $is_mapped.

175  : void
176  {
177  $this->is_mapped = $is_mapped;
178  }
bool $is_mapped

◆ setLeft()

arJoin::setLeft ( )

Definition at line 69 of file class.arJoin.php.

References setType().

69  : void
70  {
71  $this->setType(self::TYPE_LEFT);
72  }
setType(string $type)
+ Here is the call graph for this function:

◆ setOnFirstField()

arJoin::setOnFirstField ( string  $on_first_field)

Definition at line 100 of file class.arJoin.php.

References $on_first_field.

100  : void
101  {
102  $this->on_first_field = $on_first_field;
103  }
string $on_first_field

◆ setOnSecondField()

arJoin::setOnSecondField ( string  $on_second_field)

Definition at line 110 of file class.arJoin.php.

References $on_second_field.

110  : void
111  {
112  $this->on_second_field = $on_second_field;
113  }
string $on_second_field

◆ setOperator()

arJoin::setOperator ( string  $operator)

Definition at line 120 of file class.arJoin.php.

120  : void
121  {
122  $this->operator = $operator;
123  }

◆ setRght()

arJoin::setRght ( )

Definition at line 74 of file class.arJoin.php.

References setType().

74  : void
75  {
76  $this->setType(self::TYPE_RIGHT);
77  }
setType(string $type)
+ Here is the call graph for this function:

◆ setTableName()

arJoin::setTableName ( string  $table_name)

Definition at line 130 of file class.arJoin.php.

References $table_name.

130  : void
131  {
132  $this->table_name = $table_name;
133  }
string $table_name

◆ setType()

arJoin::setType ( string  $type)

Definition at line 140 of file class.arJoin.php.

References $type.

Referenced by setInner(), setLeft(), and setRght().

140  : void
141  {
142  $this->type = $type;
143  }
string $type
+ Here is the caller graph for this function:

Field Documentation

◆ $both_external

bool arJoin::$both_external = false
protected

Definition at line 39 of file class.arJoin.php.

Referenced by getBothExternal(), and setBothExternal().

◆ $fields

array arJoin::$fields = ['*']
protected

Definition at line 34 of file class.arJoin.php.

Referenced by getFields(), and setFields().

◆ $full_names

bool arJoin::$full_names = false
protected

Definition at line 38 of file class.arJoin.php.

Referenced by getFullNames(), and setFullNames().

◆ $is_mapped

bool arJoin::$is_mapped = false
protected

Definition at line 40 of file class.arJoin.php.

Referenced by isIsMapped(), and setIsMapped().

◆ $on_first_field

string arJoin::$on_first_field = ''
protected

Definition at line 36 of file class.arJoin.php.

Referenced by getOnFirstField(), and setOnFirstField().

◆ $on_second_field

string arJoin::$on_second_field = ''
protected

Definition at line 37 of file class.arJoin.php.

Referenced by getOnSecondField(), and setOnSecondField().

◆ $operator='='

string arJoin::$operator='='
protected

Definition at line 35 of file class.arJoin.php.

◆ $table_name

string arJoin::$table_name = ''
protected

Definition at line 33 of file class.arJoin.php.

Referenced by getTableName(), and setTableName().

◆ $type

string arJoin::$type = self::TYPE_NORMAL
protected

Definition at line 32 of file class.arJoin.php.

Referenced by getType(), and setType().

◆ AS_TEXT

const arJoin::AS_TEXT = ' AS '

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

◆ TYPE_INNER

const arJoin::TYPE_INNER = 'INNER'

Definition at line 30 of file class.arJoin.php.

Referenced by ActiveRecordList\innerjoin().

◆ TYPE_LEFT

const arJoin::TYPE_LEFT = 'LEFT'

Definition at line 28 of file class.arJoin.php.

Referenced by ActiveRecordList\leftjoin().

◆ TYPE_NORMAL

const arJoin::TYPE_NORMAL = self::TYPE_INNER

Definition at line 27 of file class.arJoin.php.

◆ TYPE_RIGHT

const arJoin::TYPE_RIGHT = 'RIGHT'

Definition at line 29 of file class.arJoin.php.


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