ILIAS  release_8 Revision v8.24
arConnectorSession Class Reference

Class arConnectorSession. More...

+ Inheritance diagram for arConnectorSession:
+ Collaboration diagram for arConnectorSession:

Public Member Functions

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

Static Public Member Functions

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

Data Fields

const AR_CONNECTOR_SESSION = 'arConnectorSession'
 

Detailed Description

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 21 of file class.arConnectorSession.php.

Member Function Documentation

◆ affectedRows()

arConnectorSession::affectedRows ( ActiveRecordList  $arl)

Reimplemented from arConnector.

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

170 : int
171 {
172 return count($this->readSet($arl));
173 }
readSet(ActiveRecordList $arl)

References readSet().

+ Here is the call graph for this function:

◆ checkConnection()

arConnectorSession::checkConnection ( ActiveRecord  $ar)

Reimplemented from arConnector.

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

56 : bool
57 {
58 return is_array(self::getSession());
59 }

◆ checkFieldExists()

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

Reimplemented from arConnector.

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

96 : bool
97 {
99
100 return array_key_exists($field_name, $session[0]);
101 }
static getSessionForActiveRecord(ActiveRecord $ar)
$session

References $session, and getSessionForActiveRecord().

+ Here is the call graph for this function:

◆ checkTableExists()

arConnectorSession::checkTableExists ( ActiveRecord  $ar)

Reimplemented from arConnector.

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

91 : bool
92 {
93 return is_array(self::getSessionForActiveRecord($ar));
94 }

◆ create()

arConnectorSession::create ( ActiveRecord  $ar)

Reimplemented from arConnector.

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

119 : void
120 {
121 $_SESSION[self::AR_CONNECTOR_SESSION][$ar::returnDbTableName()][$ar->getPrimaryFieldValue()] = $ar->asStdClass();
122 }

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

Referenced by update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ delete()

arConnectorSession::delete ( ActiveRecord  $ar)

Reimplemented from arConnector.

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

139 : void
140 {
141 unset($_SESSION[self::AR_CONNECTOR_SESSION][$ar::returnDbTableName()][$ar->getPrimaryFieldValue()]);
142 }

◆ getSession()

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

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

33 : array
34 {
35 if (!$_SESSION[self::AR_CONNECTOR_SESSION]) {
37 }
38
39 return $_SESSION[self::AR_CONNECTOR_SESSION];
40 }

References AR_CONNECTOR_SESSION, and resetSession().

Referenced by getSessionForActiveRecord().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSessionForActiveRecord()

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

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

45 : array
46 {
48 $ar_session = $session[$ar::returnDbTableName()];
49 if (!is_array($ar_session)) {
50 $ar_session = array();
51 }
52
53 return $ar_session;
54 }

References $session, and getSession().

Referenced by checkFieldExists(), read(), and readSet().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ installDatabase()

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

Reimplemented from arConnector.

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

69 : bool
70 {
71 return $this->resetDatabase($ar);
72 }
resetDatabase(ActiveRecord $ar)

References resetDatabase().

+ Here is the call graph for this function:

◆ nextID()

arConnectorSession::nextID ( ActiveRecord  $ar)
Returns
mixed

Reimplemented from arConnector.

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

64 : int
65 {
66 return count(self::getSessionForActiveRecord($ar)) + 1;
67 }

◆ quote()

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

Reimplemented from arConnector.

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

178 : string
179 {
180 return $value;
181 }

◆ read()

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

Reimplemented from arConnector.

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

127 : array
128 {
130
131 return array($session[$ar->getPrimaryFieldValue()]);
132 }

References $session, ActiveRecord\getPrimaryFieldValue(), and getSessionForActiveRecord().

+ Here is the call graph for this function:

◆ readSet()

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

Reimplemented from arConnector.

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

148 : array
149 {
151 foreach ($session as $i => $s) {
152 $session[$i] = (array) $s;
153 }
154 foreach ($arl->getArWhereCollection()->getWheres() as $w) {
155 $fieldname = $w->getFieldname();
156 $v = $w->getValue();
157 $operator = $w->getOperator();
158
159 foreach ($session as $i => $s) {
160 $session[$i] = (array) $s;
161 if (($operator === '=') && $s[$fieldname] !== $v) {
162 unset($session[$i]);
163 }
164 }
165 }
166
167 return $session;
168 }
$i
Definition: metadata.php:41

References $i, $session, ActiveRecordList\getAR(), ActiveRecordList\getArWhereCollection(), and getSessionForActiveRecord().

Referenced by affectedRows().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeField()

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

Reimplemented from arConnector.

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

106 : bool
107 {
108 return true;
109 }

◆ renameField()

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

Reimplemented from arConnector.

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

114 : bool
115 {
116 return true;
117 }

◆ resetDatabase()

arConnectorSession::resetDatabase ( ActiveRecord  $ar)

Reimplemented from arConnector.

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

79 : bool
80 {
81 $_SESSION[self::AR_CONNECTOR_SESSION][$ar::returnDbTableName()] = array();
82
83 return true;
84 }

References AR_CONNECTOR_SESSION.

Referenced by installDatabase(), and truncateDatabase().

+ Here is the caller graph for this function:

◆ resetSession()

static arConnectorSession::resetSession ( )
static

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

25 : void
26 {
27 $_SESSION[self::AR_CONNECTOR_SESSION] = array();
28 }

References AR_CONNECTOR_SESSION.

Referenced by getSession().

+ Here is the caller graph for this function:

◆ truncateDatabase()

arConnectorSession::truncateDatabase ( ActiveRecord  $ar)

Reimplemented from arConnector.

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

86 : bool
87 {
88 return $this->resetDatabase($ar);
89 }

References resetDatabase().

+ Here is the call graph for this function:

◆ update()

arConnectorSession::update ( ActiveRecord  $ar)

Reimplemented from arConnector.

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

134 : void
135 {
136 $this->create($ar);
137 }

References create().

+ Here is the call graph for this function:

◆ updateDatabase()

arConnectorSession::updateDatabase ( ActiveRecord  $ar)

Reimplemented from arConnector.

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

74 : bool
75 {
76 return true;
77 }

◆ updateIndices()

arConnectorSession::updateIndices ( ActiveRecord  $ar)

Reimplemented from arConnector.

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

183 : void
184 {
185 // TODO: Implement updateIndices() method.
186 }

Field Documentation

◆ AR_CONNECTOR_SESSION

const arConnectorSession::AR_CONNECTOR_SESSION = 'arConnectorSession'

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

Referenced by create(), getSession(), resetDatabase(), and resetSession().


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