ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
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)
 

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

References readSet().

234  {
235  return count($this->readSet($arl));
236  }
readSet(ActiveRecordList $arl)
+ Here is the call graph for this function:

◆ checkConnection()

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

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

54  {
55  return is_array(self::getSession());
56  }

◆ checkFieldExists()

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

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

128  {
129  $session = self::getSessionForActiveRecord($ar);
130 
131  return array_key_exists($field_name, $session[0]);
132  }

◆ checkTableExists()

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

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

117  {
118  return is_array(self::getSessionForActiveRecord($ar));
119  }

◆ create()

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

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

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

163  {
164  $_SESSION[self::AR_CONNECTOR_SESSION][$ar::returnDbTableName()][$ar->getPrimaryFieldValue()] = $ar->__asStdClass();
165  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
+ Here is the call graph for this function:

◆ delete()

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

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

References $_SESSION.

191  {
192  unset($_SESSION[self::AR_CONNECTOR_SESSION][$ar::returnDbTableName()][$ar->getPrimaryFieldValue()]);
193  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']

◆ getSession()

static arConnectorSession::getSession ( )
static
Returns
array

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

References $_SESSION.

24  {
25  if (!$_SESSION[self::AR_CONNECTOR_SESSION]) {
26  self::resetSession();
27  }
28 
29  return $_SESSION[self::AR_CONNECTOR_SESSION];
30  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']

◆ getSessionForActiveRecord()

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

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

38  {
39  $session = self::getSession();
40  $ar_session = $session[$ar::returnDbTableName()];
41  if (!is_array($ar_session)) {
42  $ar_session = array();
43  }
44 
45  return $ar_session;
46  }

◆ installDatabase()

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

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

75  {
76  return self::resetDatabase($ar);
77  }

◆ nextID()

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

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

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

◆ quote()

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

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

245  {
246  return $value;
247  }

◆ read()

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

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

References ActiveRecord\getPrimaryFieldValue().

173  {
174  $session = self::getSessionForActiveRecord($ar);
175 
176  return array( $session[$ar->getPrimaryFieldValue()] );
177  }
+ Here is the call graph for this function:

◆ readSet()

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

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

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

Referenced by affectedRows().

203  {
204  $session = self::getSessionForActiveRecord($arl->getAR());
205  foreach ($session as $i => $s) {
206  $session[$i] = (array)$s;
207  }
208  foreach ($arl->getArWhereCollection()->getWheres() as $w) {
209  $fieldname = $w->getFieldname();
210  $v = $w->getValue();
211  $operator = $w->getOperator();
212 
213  foreach ($session as $i => $s) {
214  $session[$i] = (array)$s;
215  switch ($operator) {
216  case '=':
217  if ($s[$fieldname] != $v) {
218  unset($session[$i]);
219  }
220  break;
221  }
222  }
223  }
224 
225  return $session;
226  }
+ 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 142 of file class.arConnectorSession.php.

142  {
143  return true;
144  }

◆ renameField()

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

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

155  {
156  return true;
157  }

◆ resetDatabase()

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

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

References $_SESSION.

95  {
96  $_SESSION[self::AR_CONNECTOR_SESSION][$ar::returnDbTableName()] = array();
97 
98  return true;
99  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']

◆ resetSession()

static arConnectorSession::resetSession ( )
static

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

References $_SESSION.

16  {
17  $_SESSION[self::AR_CONNECTOR_SESSION] = array();
18  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']

◆ truncateDatabase()

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

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

107  {
108  return self::resetDatabase($ar);
109  }

◆ update()

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

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

183  {
184  self::create($ar);
185  }

◆ updateDatabase()

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

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

85  {
86  return true;
87  }

◆ updateIndices()

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

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

253  {
254  // TODO: Implement updateIndices() method.
255  }

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: