ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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, $fields)
 
 updateDatabase (ActiveRecord $ar)
 
 resetDatabase (ActiveRecord $ar)
 
 truncateDatabase (ActiveRecord $ar)
 
 checkTableExists (ActiveRecord $ar)
 
 checkFieldExists (ActiveRecord $ar, $field_name)
 
 removeField (ActiveRecord $ar, $field_name)
 
 renameField (ActiveRecord $ar, $old_name, $new_name)
 
 create (ActiveRecord $ar)
 
 read (ActiveRecord $ar)
 
 update (ActiveRecord $ar)
 
 delete (ActiveRecord $ar)
 
 readSet (ActiveRecordList $arl)
 
 affectedRows (ActiveRecordList $arl)
 
 quote ($value, $type)
 
 updateIndices (ActiveRecord $ar)
 
- Public Member Functions inherited from arConnector
 nextID (ActiveRecord $ar)
 
 checkConnection (ActiveRecord $ar)
 
 installDatabase (ActiveRecord $ar, $fields)
 
 updateDatabase (ActiveRecord $ar)
 
 resetDatabase (ActiveRecord $ar)
 
 truncateDatabase (ActiveRecord $ar)
 
 checkTableExists (ActiveRecord $ar)
 
 checkFieldExists (ActiveRecord $ar, $field_name)
 
 removeField (ActiveRecord $ar, $field_name)
 
 renameField (ActiveRecord $ar, $old_name, $new_name)
 
 create (ActiveRecord $ar)
 
 read (ActiveRecord $ar)
 
 update (ActiveRecord $ar)
 
 delete (ActiveRecord $ar)
 
 readSet (ActiveRecordList $arl)
 
 affectedRows (ActiveRecordList $arl)
 
 quote ($value, $type)
 
 updateIndices (ActiveRecord $ar)
 
 fixDate ($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 11 of file class.arConnectorSession.php.

Member Function Documentation

◆ affectedRows()

arConnectorSession::affectedRows ( ActiveRecordList  $arl)
Parameters
ActiveRecordList$arl
Returns
int

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

References readSet().

253  {
254  return count($this->readSet($arl));
255  }
readSet(ActiveRecordList $arl)
+ Here is the call graph for this function:

◆ checkConnection()

arConnectorSession::checkConnection ( ActiveRecord  $ar)
Parameters
ActiveRecord$ar
Returns
bool

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

58  {
59  return is_array(self::getSession());
60  }

◆ checkFieldExists()

arConnectorSession::checkFieldExists ( ActiveRecord  $ar,
  $field_name 
)
Parameters
ActiveRecord$ar
$field_name
Returns
mixed

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

References $session.

139  {
140  $session = self::getSessionForActiveRecord($ar);
141 
142  return array_key_exists($field_name, $session[0]);
143  }
$session

◆ checkTableExists()

arConnectorSession::checkTableExists ( ActiveRecord  $ar)
Parameters
ActiveRecord$ar
Returns
mixed

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

127  {
128  return is_array(self::getSessionForActiveRecord($ar));
129  }

◆ create()

arConnectorSession::create ( ActiveRecord  $ar)
Parameters
ActiveRecord$ar

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

References $_SESSION, ActiveRecord\__asStdClass(), and ActiveRecord\getPrimaryFieldValue().

177  {
178  $_SESSION[self::AR_CONNECTOR_SESSION][$ar::returnDbTableName()][$ar->getPrimaryFieldValue()] = $ar->__asStdClass();
179  }
$_SESSION["AccountId"]
+ Here is the call graph for this function:

◆ delete()

arConnectorSession::delete ( ActiveRecord  $ar)
Parameters
ActiveRecord$ar

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

References $_SESSION.

208  {
209  unset($_SESSION[self::AR_CONNECTOR_SESSION][$ar::returnDbTableName()][$ar->getPrimaryFieldValue()]);
210  }
$_SESSION["AccountId"]

◆ getSession()

static arConnectorSession::getSession ( )
static
Returns
array

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

References $_SESSION.

26  {
27  if (!$_SESSION[self::AR_CONNECTOR_SESSION]) {
28  self::resetSession();
29  }
30 
31  return $_SESSION[self::AR_CONNECTOR_SESSION];
32  }
$_SESSION["AccountId"]

◆ getSessionForActiveRecord()

static arConnectorSession::getSessionForActiveRecord ( ActiveRecord  $ar)
static
Parameters
ActiveRecord$ar
Returns
array

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

References $session, and array.

41  {
42  $session = self::getSession();
43  $ar_session = $session[$ar::returnDbTableName()];
44  if (!is_array($ar_session)) {
45  $ar_session = array();
46  }
47 
48  return $ar_session;
49  }
$session
Create styles array
The data for the language used.

◆ installDatabase()

arConnectorSession::installDatabase ( ActiveRecord  $ar,
  $fields 
)
Parameters
ActiveRecord$ar
$fields
Returns
bool

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

81  {
82  return self::resetDatabase($ar);
83  }

◆ nextID()

arConnectorSession::nextID ( ActiveRecord  $ar)
Parameters
ActiveRecord$ar
Returns
mixed

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

69  {
70  return count(self::getSessionForActiveRecord($ar)) + 1;
71  }

◆ quote()

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

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

265  {
266  return $value;
267  }

◆ read()

arConnectorSession::read ( ActiveRecord  $ar)
Parameters
ActiveRecord$ar
Returns
array

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

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

188  {
189  $session = self::getSessionForActiveRecord($ar);
190 
191  return array( $session[$ar->getPrimaryFieldValue()] );
192  }
$session
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ readSet()

arConnectorSession::readSet ( ActiveRecordList  $arl)
Parameters
ActiveRecordList$arl

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

References $i, $s, $session, $w, array, ActiveRecordList\getAR(), and ActiveRecordList\getArWhereCollection().

Referenced by affectedRows().

221  {
222  $session = self::getSessionForActiveRecord($arl->getAR());
223  foreach ($session as $i => $s) {
224  $session[$i] = (array) $s;
225  }
226  foreach ($arl->getArWhereCollection()->getWheres() as $w) {
227  $fieldname = $w->getFieldname();
228  $v = $w->getValue();
229  $operator = $w->getOperator();
230 
231  foreach ($session as $i => $s) {
232  $session[$i] = (array) $s;
233  switch ($operator) {
234  case '=':
235  if ($s[$fieldname] != $v) {
236  unset($session[$i]);
237  }
238  break;
239  }
240  }
241  }
242 
243  return $session;
244  }
$session
$s
Definition: pwgen.php:45
$w
Create styles array
The data for the language used.
$i
Definition: disco.tpl.php:19
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeField()

arConnectorSession::removeField ( ActiveRecord  $ar,
  $field_name 
)
Parameters
ActiveRecord$ar
$field_name
Returns
bool
Exceptions
arException

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

154  {
155  return true;
156  }

◆ renameField()

arConnectorSession::renameField ( ActiveRecord  $ar,
  $old_name,
  $new_name 
)
Parameters
ActiveRecord$ar
$old_name
$new_name
Returns
bool
Exceptions
arException

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

168  {
169  return true;
170  }

◆ resetDatabase()

arConnectorSession::resetDatabase ( ActiveRecord  $ar)
Parameters
ActiveRecord$ar
Returns
bool

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

References $_SESSION, and array.

103  {
104  $_SESSION[self::AR_CONNECTOR_SESSION][$ar::returnDbTableName()] = array();
105 
106  return true;
107  }
$_SESSION["AccountId"]
Create styles array
The data for the language used.

◆ resetSession()

static arConnectorSession::resetSession ( )
static

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

References $_SESSION, and array.

17  {
18  $_SESSION[self::AR_CONNECTOR_SESSION] = array();
19  }
$_SESSION["AccountId"]
Create styles array
The data for the language used.

◆ truncateDatabase()

arConnectorSession::truncateDatabase ( ActiveRecord  $ar)
Parameters
ActiveRecord$ar
Returns
bool

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

116  {
117  return self::resetDatabase($ar);
118  }

◆ update()

arConnectorSession::update ( ActiveRecord  $ar)
Parameters
ActiveRecord$ar

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

199  {
200  self::create($ar);
201  }

◆ updateDatabase()

arConnectorSession::updateDatabase ( ActiveRecord  $ar)
Parameters
ActiveRecord$ar
Returns
bool

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

92  {
93  return true;
94  }

◆ updateIndices()

arConnectorSession::updateIndices ( ActiveRecord  $ar)
Parameters
ActiveRecord$ar

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

274  {
275  // TODO: Implement updateIndices() method.
276  }

Field Documentation

◆ AR_CONNECTOR_SESSION

const arConnectorSession::AR_CONNECTOR_SESSION = 'arConnectorSession'

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


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