ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilECSRemoteUser Class Reference

Storage of ecs remote user. More...

+ Collaboration diagram for ilECSRemoteUser:

Public Member Functions

 __construct ($a_eru_id=0)
 Constructor.
 exists ()
 Check if entry exists for user.
 getId ()
 setServerId ($a_sid)
 getServerId ()
 setMid ($a_mid)
 getMid ()
 setUserId ($a_usr_id)
 getUserId ()
 setRemoteUserId ($a_remote_id)
 getRemoteUserId ()
 update ()
 Update remote user entry.
 create ()
 Create nerw remote user entry.

Static Public Member Functions

static factory ($a_usr_id)
 Get instance for usr_id.

Protected Member Functions

 read ()
 Read data set.

Private Attributes

 $eru_id = 0
 $sid = 0
 $mid = 0
 $usr_id = 0
 $remote_usr_id = ''

Detailed Description

Storage of ecs remote user.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e $Id$

Definition at line 8 of file class.ilECSRemoteUser.php.

Constructor & Destructor Documentation

ilECSRemoteUser::__construct (   $a_eru_id = 0)

Constructor.

Definition at line 20 of file class.ilECSRemoteUser.php.

References read().

{
$this->eru_id = $a_eru_id;
$this->read();
}

+ Here is the call graph for this function:

Member Function Documentation

ilECSRemoteUser::create ( )

Create nerw remote user entry.

Definition at line 130 of file class.ilECSRemoteUser.php.

References $GLOBALS, $query, getMid(), getRemoteUserId(), getServerId(), and getUserId().

{
$next_id = $GLOBALS['ilDB']->nextId('ecs_remote_user');
$query = 'INSERT INTO ecs_remote_user (eru_id, sid, mid, usr_id, remote_usr_id) '.
'VALUES( '.
$GLOBALS['ilDB']->quote($next_id).', '.
$GLOBALS['ilDB']->quote($this->getServerId(),'integer').', '.
$GLOBALS['ilDB']->quote($this->getMid(),'integer').', '.
$GLOBALS['ilDB']->quote($this->getUserId(),'text').', '.
$GLOBALS['ilDB']->quote($this->getRemoteUserId(),'text').' '.
')';
$GLOBALS['ilDB']->manipulate($query);
}

+ Here is the call graph for this function:

ilECSRemoteUser::exists ( )

Check if entry exists for user.

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

References $ilDB, $query, $res, $row, DB_FETCHMODE_OBJECT, getMid(), getServerId(), and getUserId().

{
global $ilDB;
$query = 'SELECT eru_id FROM ecs_remote_user '.
'WHERE sid = '.$ilDB->quote($this->getServerId(),'integer').' '.
'AND mid = '.$ilDB->quote($this->getMid(),'integer').' '.
'AND usr_id = '.$ilDB->quote($this->getUserId(),'integer');
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return (bool) $row->eru_id;
}
return false;
}

+ Here is the call graph for this function:

static ilECSRemoteUser::factory (   $a_usr_id)
static

Get instance for usr_id.

Parameters
type$a_usr_id
Returns
|null

Definition at line 31 of file class.ilECSRemoteUser.php.

References $ilDB, $query, $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by ilECSAppEventListener\updateEnrolmentStatus().

{
global $ilDB;
$query = 'SELECT eru_id FROM ecs_remote_user '.
'WHERE usr_id = '.$ilDB->quote($a_usr_id,'integer');
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return new self($row->eru_id);
}
return null;
}

+ Here is the caller graph for this function:

ilECSRemoteUser::getId ( )

Definition at line 65 of file class.ilECSRemoteUser.php.

References $eru_id.

Referenced by read(), and update().

{
return $this->eru_id;
}

+ Here is the caller graph for this function:

ilECSRemoteUser::getMid ( )

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

References $mid.

Referenced by create(), exists(), and update().

{
return $this->mid;
}

+ Here is the caller graph for this function:

ilECSRemoteUser::getRemoteUserId ( )

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

References $remote_usr_id.

Referenced by create(), and update().

{
}

+ Here is the caller graph for this function:

ilECSRemoteUser::getServerId ( )

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

References $sid.

Referenced by create(), exists(), and update().

{
return $this->sid;
}

+ Here is the caller graph for this function:

ilECSRemoteUser::getUserId ( )

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

References $usr_id.

Referenced by create(), exists(), and update().

{
return $this->usr_id;
}

+ Here is the caller graph for this function:

ilECSRemoteUser::read ( )
protected

Read data set.

Returns
boolean

Definition at line 149 of file class.ilECSRemoteUser.php.

References $GLOBALS, $query, $res, $row, DB_FETCHMODE_OBJECT, getId(), setMid(), setRemoteUserId(), setServerId(), and setUserId().

Referenced by __construct().

{
if(!$this->getId())
{
return false;
}
$query = 'SELECT * FROM ecs_remote_user '.
'WHERE eru_id = '.$GLOBALS['ilDB']->quote($this->getId(),'integer');
$res = $GLOBALS['ilDB']->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$this->setServerId($row->sid);
$this->setMid($row->mid);
$this->setUserId($row->usr_id);
$this->setRemoteUserId($row->remote_usr_id);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilECSRemoteUser::setMid (   $a_mid)

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

Referenced by read().

{
$this->mid = $a_mid;
}

+ Here is the caller graph for this function:

ilECSRemoteUser::setRemoteUserId (   $a_remote_id)

Definition at line 101 of file class.ilECSRemoteUser.php.

Referenced by read().

{
$this->remote_usr_id = $a_remote_id;
}

+ Here is the caller graph for this function:

ilECSRemoteUser::setServerId (   $a_sid)

Definition at line 70 of file class.ilECSRemoteUser.php.

Referenced by read().

{
$this->sid = $a_sid;
}

+ Here is the caller graph for this function:

ilECSRemoteUser::setUserId (   $a_usr_id)

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

Referenced by read().

{
$this->usr_id = $a_usr_id;
}

+ Here is the caller graph for this function:

ilECSRemoteUser::update ( )

Update remote user entry.

Returns
boolean

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

References $GLOBALS, $query, getId(), getMid(), getRemoteUserId(), getServerId(), and getUserId().

{
$query = 'UPDATE ecs_remote_user SET '.
'sid = '.$GLOBALS['ilDB']->quote($this->getServerId(),'integer').', '.
'mid = '.$GLOBALS['ilDB']->quote($this->getMid(),'integer').', '.
'usr_id = '.$GLOBALS['ilDB']->quote($this->getUserId(),'text').', '.
'remote_usr_id = '.$GLOBALS['ilDB']->quote($this->getRemoteUserId(),'text').' '.
'WHERE eru_id = '.$GLOBALS['ilDB']->quote($this->getId());
$GLOBALS['ilDB']->manipulate($query);
return true;
}

+ Here is the call graph for this function:

Field Documentation

ilECSRemoteUser::$eru_id = 0
private

Definition at line 10 of file class.ilECSRemoteUser.php.

Referenced by getId().

ilECSRemoteUser::$mid = 0
private

Definition at line 12 of file class.ilECSRemoteUser.php.

Referenced by getMid().

ilECSRemoteUser::$remote_usr_id = ''
private

Definition at line 14 of file class.ilECSRemoteUser.php.

Referenced by getRemoteUserId().

ilECSRemoteUser::$sid = 0
private

Definition at line 11 of file class.ilECSRemoteUser.php.

Referenced by getServerId().

ilECSRemoteUser::$usr_id = 0
private

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

Referenced by getUserId().


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