ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups 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)

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

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

Reimplemented from arConnector.

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

References readSet().

{
return count($this->readSet($arl));
}

+ Here is the call graph for this function:

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

Reimplemented from arConnector.

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

{
return is_array(self::getSession());
}
arConnectorSession::checkFieldExists ( ActiveRecord  $ar,
  $field_name 
)
Parameters
ActiveRecord$ar
$field_name
Returns
mixed

Reimplemented from arConnector.

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

References getSessionForActiveRecord().

{
return array_key_exists($field_name, $session[0]);
}

+ Here is the call graph for this function:

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

Reimplemented from arConnector.

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

{
return is_array(self::getSessionForActiveRecord($ar));
}
arConnectorSession::create ( ActiveRecord  $ar)
Parameters
ActiveRecord$ar

Reimplemented from arConnector.

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

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

Referenced by update().

{
$_SESSION[self::AR_CONNECTOR_SESSION][$ar::returnDbTableName()][$ar->getPrimaryFieldValue()] = $ar->__asStdClass();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Reimplemented from arConnector.

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

References $_SESSION.

{
unset($_SESSION[self::AR_CONNECTOR_SESSION][$ar::returnDbTableName()][$ar->getPrimaryFieldValue()]);
}
static arConnectorSession::getSession ( )
static
Returns
array

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

References $_SESSION, AR_CONNECTOR_SESSION, and resetSession().

Referenced by getSessionForActiveRecord().

{
if (!$_SESSION[self::AR_CONNECTOR_SESSION]) {
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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

References getSession().

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

{
$session = self::getSession();
$ar_session = $session[$ar::returnDbTableName()];
if (!is_array($ar_session)) {
$ar_session = array();
}
return $ar_session;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Reimplemented from arConnector.

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

References resetDatabase().

{
return self::resetDatabase($ar);
}

+ Here is the call graph for this function:

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

Reimplemented from arConnector.

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

{
return count(self::getSessionForActiveRecord($ar)) + 1;
}
arConnectorSession::quote (   $value,
  $type 
)
Parameters
$value
$type
Returns
string

Reimplemented from arConnector.

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

{
return $value;
}
arConnectorSession::read ( ActiveRecord  $ar)
Parameters
ActiveRecord$ar
Returns
array

Reimplemented from arConnector.

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

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

{
return array( $session[$ar->getPrimaryFieldValue()] );
}

+ Here is the call graph for this function:

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

Reimplemented from arConnector.

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

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

Referenced by affectedRows().

{
foreach ($session as $i => $s) {
$session[$i] = (array)$s;
}
foreach ($arl->getArWhereCollection()->getWheres() as $w) {
$fieldname = $w->getFieldname();
$v = $w->getValue();
$operator = $w->getOperator();
foreach ($session as $i => $s) {
$session[$i] = (array)$s;
switch ($operator) {
case '=':
if ($s[$fieldname] != $v) {
unset($session[$i]);
}
break;
}
}
}
return $session;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Reimplemented from arConnector.

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

{
return true;
}
arConnectorSession::renameField ( ActiveRecord  $ar,
  $old_name,
  $new_name 
)
Parameters
ActiveRecord$ar
$old_name
$new_name
Returns
bool
Exceptions
arException

Reimplemented from arConnector.

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

{
return true;
}
arConnectorSession::resetDatabase ( ActiveRecord  $ar)
Parameters
ActiveRecord$ar
Returns
bool

Reimplemented from arConnector.

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

References $_SESSION, and AR_CONNECTOR_SESSION.

Referenced by installDatabase(), and truncateDatabase().

{
$_SESSION[self::AR_CONNECTOR_SESSION][$ar::returnDbTableName()] = array();
return true;
}

+ Here is the caller graph for this function:

static arConnectorSession::resetSession ( )
static

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

References $_SESSION, and AR_CONNECTOR_SESSION.

Referenced by getSession().

+ Here is the caller graph for this function:

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

Reimplemented from arConnector.

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

References resetDatabase().

{
return self::resetDatabase($ar);
}

+ Here is the call graph for this function:

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

Reimplemented from arConnector.

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

References create().

{
}

+ Here is the call graph for this function:

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

Reimplemented from arConnector.

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

{
return true;
}
arConnectorSession::updateIndices ( ActiveRecord  $ar)
Parameters
ActiveRecord$ar

Reimplemented from arConnector.

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

{
// TODO: Implement updateIndices() method.
}

Field Documentation

const arConnectorSession::AR_CONNECTOR_SESSION = 'arConnectorSession'

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

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


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