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

Public Member Functions

 checkConnection (ActiveRecord $activeRecord)
 
 nextID (ActiveRecord $activeRecord)
 
 installDatabase (ActiveRecord $activeRecord, array $fields)
 
 updateDatabase (ActiveRecord $activeRecord)
 
 resetDatabase (ActiveRecord $activeRecord)
 
 truncateDatabase (ActiveRecord $activeRecord)
 
 checkTableExists (ActiveRecord $activeRecord)
 
 checkFieldExists (ActiveRecord $activeRecord, string $field_name)
 
 removeField (ActiveRecord $activeRecord, string $field_name)
 
 renameField (ActiveRecord $activeRecord, string $old_name, string $new_name)
 
 create (ActiveRecord $activeRecord)
 
 read (ActiveRecord $activeRecord)
 
 update (ActiveRecord $activeRecord)
 
 delete (ActiveRecord $activeRecord)
 
 readSet (ActiveRecordList $activeRecordList)
 
 affectedRows (ActiveRecordList $activeRecordList)
 
 quote ($value, string $type)
 
 updateIndices (ActiveRecord $activeRecord)
 
- Public Member Functions inherited from arConnector
 nextID (ActiveRecord $activeRecord)
 
 checkConnection (ActiveRecord $activeRecord)
 
 installDatabase (ActiveRecord $activeRecord, array $fields)
 
 updateDatabase (ActiveRecord $activeRecord)
 
 resetDatabase (ActiveRecord $activeRecord)
 
 truncateDatabase (ActiveRecord $activeRecord)
 
 checkTableExists (ActiveRecord $activeRecord)
 
 checkFieldExists (ActiveRecord $activeRecord, string $field_name)
 
 removeField (ActiveRecord $activeRecord, string $field_name)
 
 renameField (ActiveRecord $activeRecord, string $old_name, string $new_name)
 
 create (ActiveRecord $activeRecord)
 
 read (ActiveRecord $activeRecord)
 
 update (ActiveRecord $activeRecord)
 
 delete (ActiveRecord $activeRecord)
 
 readSet (ActiveRecordList $activeRecordList)
 
 affectedRows (ActiveRecordList $activeRecordList)
 
 quote (mixed $value, string $type)
 
 updateIndices (ActiveRecord $activeRecord)
 
 fixDate (string $value)
 

Static Public Member Functions

static resetSession ()
 
static getSession ()
 
static getSessionForActiveRecord (ActiveRecord $activeRecord)
 

Data Fields

const AR_CONNECTOR_SESSION = 'arConnectorSession'
 

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 arConnectorSession

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

Member Function Documentation

◆ affectedRows()

arConnectorSession::affectedRows ( ActiveRecordList  $activeRecordList)

Definition at line 181 of file class.arConnectorSession.php.

References readSet().

181  : int
182  {
183  return count($this->readSet($activeRecordList));
184  }
readSet(ActiveRecordList $activeRecordList)
+ Here is the call graph for this function:

◆ checkConnection()

arConnectorSession::checkConnection ( ActiveRecord  $activeRecord)

Definition at line 59 of file class.arConnectorSession.php.

59  : bool
60  {
61  return is_array(self::getSession());
62  }

◆ checkFieldExists()

arConnectorSession::checkFieldExists ( ActiveRecord  $activeRecord,
string  $field_name 
)

Definition at line 99 of file class.arConnectorSession.php.

99  : bool
100  {
101  $session = self::getSessionForActiveRecord($activeRecord);
102 
103  return array_key_exists($field_name, $session[0]);
104  }

◆ checkTableExists()

arConnectorSession::checkTableExists ( ActiveRecord  $activeRecord)

Definition at line 94 of file class.arConnectorSession.php.

94  : bool
95  {
96  return is_array(self::getSessionForActiveRecord($activeRecord));
97  }

◆ create()

arConnectorSession::create ( ActiveRecord  $activeRecord)

Definition at line 122 of file class.arConnectorSession.php.

References ActiveRecord\asStdClass(), and ActiveRecord\getPrimaryFieldValue().

Referenced by update().

122  : void
123  {
124  $_SESSION[self::AR_CONNECTOR_SESSION][$activeRecord::returnDbTableName()][$activeRecord->getPrimaryFieldValue(
125  )] = $activeRecord->asStdClass();
126  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ delete()

arConnectorSession::delete ( ActiveRecord  $activeRecord)

Definition at line 143 of file class.arConnectorSession.php.

143  : void
144  {
145  unset(
146  $_SESSION[self::AR_CONNECTOR_SESSION][$activeRecord::returnDbTableName(
147  )][$activeRecord->getPrimaryFieldValue()]
148  );
149  }

◆ getSession()

static arConnectorSession::getSession ( )
static
Returns
mixed[]

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

36  : array
37  {
38  if (!$_SESSION[self::AR_CONNECTOR_SESSION]) {
39  self::resetSession();
40  }
41 
42  return $_SESSION[self::AR_CONNECTOR_SESSION];
43  }

◆ getSessionForActiveRecord()

static arConnectorSession::getSessionForActiveRecord ( ActiveRecord  $activeRecord)
static
Returns
mixed[]

Definition at line 48 of file class.arConnectorSession.php.

48  : array
49  {
50  $session = self::getSession();
51  $ar_session = $session[$activeRecord::returnDbTableName()];
52  if (!is_array($ar_session)) {
53  return [];
54  }
55 
56  return $ar_session;
57  }

◆ installDatabase()

arConnectorSession::installDatabase ( ActiveRecord  $activeRecord,
array  $fields 
)

Definition at line 72 of file class.arConnectorSession.php.

References resetDatabase().

72  : bool
73  {
74  return $this->resetDatabase($activeRecord);
75  }
resetDatabase(ActiveRecord $activeRecord)
+ Here is the call graph for this function:

◆ nextID()

arConnectorSession::nextID ( ActiveRecord  $activeRecord)
Returns
mixed

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

67  : int
68  {
69  return count(self::getSessionForActiveRecord($activeRecord)) + 1;
70  }

◆ quote()

arConnectorSession::quote (   $value,
string  $type 
)
Parameters
$value

Definition at line 189 of file class.arConnectorSession.php.

189  : string
190  {
191  return $value;
192  }

◆ read()

arConnectorSession::read ( ActiveRecord  $activeRecord)
Returns
mixed[]

Definition at line 131 of file class.arConnectorSession.php.

References ActiveRecord\getPrimaryFieldValue().

131  : array
132  {
133  $session = self::getSessionForActiveRecord($activeRecord);
134 
135  return [$session[$activeRecord->getPrimaryFieldValue()]];
136  }
+ Here is the call graph for this function:

◆ readSet()

arConnectorSession::readSet ( ActiveRecordList  $activeRecordList)
Returns
mixed[]

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

References ActiveRecordList\getAR(), and ActiveRecordList\getArWhereCollection().

Referenced by affectedRows().

155  : array
156  {
157  $session = self::getSessionForActiveRecord($activeRecordList->getAR());
158  foreach ($session as $i => $s) {
159  $session[$i] = (array) $s;
160  }
161  foreach ($activeRecordList->getArWhereCollection()->getWheres() as $arWhere) {
162  $fieldname = $arWhere->getFieldname();
163  $v = $arWhere->getValue();
164  $operator = $arWhere->getOperator();
165 
166  foreach ($session as $i => $s) {
167  $session[$i] = (array) $s;
168  if ($operator !== '=') {
169  continue;
170  }
171  if ($s[$fieldname] === $v) {
172  continue;
173  }
174  unset($session[$i]);
175  }
176  }
177 
178  return $session;
179  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeField()

arConnectorSession::removeField ( ActiveRecord  $activeRecord,
string  $field_name 
)
Exceptions
arException

Definition at line 109 of file class.arConnectorSession.php.

109  : bool
110  {
111  return true;
112  }

◆ renameField()

arConnectorSession::renameField ( ActiveRecord  $activeRecord,
string  $old_name,
string  $new_name 
)
Exceptions
arException

Definition at line 117 of file class.arConnectorSession.php.

117  : bool
118  {
119  return true;
120  }

◆ resetDatabase()

arConnectorSession::resetDatabase ( ActiveRecord  $activeRecord)

Definition at line 82 of file class.arConnectorSession.php.

Referenced by installDatabase(), and truncateDatabase().

82  : bool
83  {
84  $_SESSION[self::AR_CONNECTOR_SESSION][$activeRecord::returnDbTableName()] = [];
85 
86  return true;
87  }
+ Here is the caller graph for this function:

◆ resetSession()

static arConnectorSession::resetSession ( )
static

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

28  : void
29  {
30  $_SESSION[self::AR_CONNECTOR_SESSION] = [];
31  }

◆ truncateDatabase()

arConnectorSession::truncateDatabase ( ActiveRecord  $activeRecord)

Definition at line 89 of file class.arConnectorSession.php.

References resetDatabase().

89  : bool
90  {
91  return $this->resetDatabase($activeRecord);
92  }
resetDatabase(ActiveRecord $activeRecord)
+ Here is the call graph for this function:

◆ update()

arConnectorSession::update ( ActiveRecord  $activeRecord)

Definition at line 138 of file class.arConnectorSession.php.

References create().

138  : void
139  {
140  $this->create($activeRecord);
141  }
create(ActiveRecord $activeRecord)
+ Here is the call graph for this function:

◆ updateDatabase()

arConnectorSession::updateDatabase ( ActiveRecord  $activeRecord)

Definition at line 77 of file class.arConnectorSession.php.

77  : bool
78  {
79  return true;
80  }

◆ updateIndices()

arConnectorSession::updateIndices ( ActiveRecord  $activeRecord)

Definition at line 194 of file class.arConnectorSession.php.

194  : void
195  {
196  // TODO: Implement updateIndices() method.
197  }

Field Documentation

◆ AR_CONNECTOR_SESSION

const arConnectorSession::AR_CONNECTOR_SESSION = 'arConnectorSession'

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


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