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

Public Member Functions

 __construct (private bool $disabled_escaping=false)
 
 asSQLStatement (ActiveRecord $activeRecord, ilDBInterface $db)
 
 getTableName ()
 
 setTableName (string $table_name)
 
 getAs ()
 
 setAs (string $as)
 
 getFieldName ()
 
 setFieldName (string $field_name)
 
- Public Member Functions inherited from arStatement
 asSQLStatement (ActiveRecord $activeRecord, ilDBInterface $db)
 
 getTableNameAs ()
 
 setTableNameAs (string $table_name_as)
 

Protected Attributes

string $table_name = ''
 
string $as = ''
 
string $field_name = ''
 
- Protected Attributes inherited from arStatement
string $table_name_as = ''
 

Additional Inherited Members

- Protected Member Functions inherited from arStatement
 wrapFields (array $fields, ilDBInterface $db)
 
 wrapField (string $field, ilDBInterface $db)
 

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 arSelect

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.arSelect.php.

Constructor & Destructor Documentation

◆ __construct()

arSelect::__construct ( private bool  $disabled_escaping = false)
Parameters
bool$disabled_escapingIn some special cases, one need to disable the escaping of the field name. In this cases, the consumer is responsible to avoid sqm injection.

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

35  {
36  }

Member Function Documentation

◆ asSQLStatement()

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

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

References getAs(), getFieldName(), getTableName(), and arStatement\wrapField().

38  : string
39  {
40  $return = '';
41  if ($this->getTableName() !== '' && $this->getTableName() !== '0') {
42  $return .= $this->getTableName() . '.';
43  }
44  if ($this->disabled_escaping) {
45  $return .= $this->getFieldName();
46  } else {
47  $return .= $this->wrapField($this->getFieldName(), $db);
48  }
49  if ($this->getAs() && $this->getFieldName() !== '*') {
50  $return .= ' AS ' . $this->getAs();
51  }
52 
53  return $return;
54  }
wrapField(string $field, ilDBInterface $db)
+ Here is the call graph for this function:

◆ getAs()

arSelect::getAs ( )

Definition at line 66 of file class.arSelect.php.

References $as.

Referenced by asSQLStatement().

66  : string
67  {
68  return $this->as;
69  }
string $as
+ Here is the caller graph for this function:

◆ getFieldName()

arSelect::getFieldName ( )

Definition at line 76 of file class.arSelect.php.

References $field_name.

Referenced by asSQLStatement().

76  : string
77  {
78  return $this->field_name;
79  }
string $field_name
+ Here is the caller graph for this function:

◆ getTableName()

arSelect::getTableName ( )

Definition at line 56 of file class.arSelect.php.

References $table_name.

Referenced by asSQLStatement().

56  : string
57  {
58  return $this->table_name;
59  }
string $table_name
+ Here is the caller graph for this function:

◆ setAs()

arSelect::setAs ( string  $as)

Definition at line 71 of file class.arSelect.php.

References $as.

71  : void
72  {
73  $this->as = $as;
74  }
string $as

◆ setFieldName()

arSelect::setFieldName ( string  $field_name)

Definition at line 81 of file class.arSelect.php.

References $field_name.

81  : void
82  {
83  $this->field_name = $field_name;
84  }
string $field_name

◆ setTableName()

arSelect::setTableName ( string  $table_name)

Definition at line 61 of file class.arSelect.php.

References $table_name.

61  : void
62  {
63  $this->table_name = $table_name;
64  }
string $table_name

Field Documentation

◆ $as

string arSelect::$as = ''
protected

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

Referenced by getAs(), and setAs().

◆ $field_name

string arSelect::$field_name = ''
protected

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

Referenced by getFieldName(), and setFieldName().

◆ $table_name

string arSelect::$table_name = ''
protected

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

Referenced by getTableName(), and setTableName().


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