ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilECSRemoteUser Class Reference

Storage of ecs remote user. More...

+ Collaboration diagram for ilECSRemoteUser:

Public Member Functions

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

Static Public Member Functions

static factory ($a_usr_id)
 Get instance for usr_id. More...
 

Protected Member Functions

 read ()
 Read data set. More...
 

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

◆ __construct()

ilECSRemoteUser::__construct (   $a_eru_id = 0)

Constructor.

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

References read().

21  {
22  $this->eru_id = $a_eru_id;
23  $this->read();
24  }
read()
Read data set.
+ Here is the call graph for this function:

Member Function Documentation

◆ create()

ilECSRemoteUser::create ( )

Create nerw remote user entry.

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

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

129  {
130  $next_id = $GLOBALS['ilDB']->nextId('ecs_remote_user');
131  $query = 'INSERT INTO ecs_remote_user (eru_id, sid, mid, usr_id, remote_usr_id) ' .
132  'VALUES( ' .
133  $GLOBALS['ilDB']->quote($next_id) . ', ' .
134  $GLOBALS['ilDB']->quote($this->getServerId(), 'integer') . ', ' .
135  $GLOBALS['ilDB']->quote($this->getMid(), 'integer') . ', ' .
136  $GLOBALS['ilDB']->quote($this->getUserId(), 'text') . ', ' .
137  $GLOBALS['ilDB']->quote($this->getRemoteUserId(), 'text') . ' ' .
138  ')';
139  $GLOBALS['ilDB']->manipulate($query);
140  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
$query
+ Here is the call graph for this function:

◆ exists()

ilECSRemoteUser::exists ( )

Check if entry exists for user.

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

References $ilDB, $query, $res, $row, ilDBConstants\FETCHMODE_OBJECT, getMid(), getServerId(), and getUserId().

48  {
49  global $ilDB;
50 
51  $query = 'SELECT eru_id FROM ecs_remote_user ' .
52  'WHERE sid = ' . $ilDB->quote($this->getServerId(), 'integer') . ' ' .
53  'AND mid = ' . $ilDB->quote($this->getMid(), 'integer') . ' ' .
54  'AND usr_id = ' . $ilDB->quote($this->getUserId(), 'integer');
55  $res = $ilDB->query($query);
56  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
57  return (bool) $row->eru_id;
58  }
59  return false;
60  }
foreach($_POST as $key=> $value) $res
$query
global $ilDB
+ Here is the call graph for this function:

◆ factory()

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 ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilECSAppEventListener\updateEnrolmentStatus().

32  {
33  global $ilDB;
34 
35  $query = 'SELECT eru_id FROM ecs_remote_user ' .
36  'WHERE usr_id = ' . $ilDB->quote($a_usr_id, 'integer');
37  $res = $ilDB->query($query);
38  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
39  return new self($row->eru_id);
40  }
41  return null;
42  }
foreach($_POST as $key=> $value) $res
$query
global $ilDB
+ Here is the caller graph for this function:

◆ getId()

ilECSRemoteUser::getId ( )

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

References $eru_id.

Referenced by read(), and update().

64  {
65  return $this->eru_id;
66  }
+ Here is the caller graph for this function:

◆ getMid()

ilECSRemoteUser::getMid ( )

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

References $mid.

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

84  {
85  return $this->mid;
86  }
+ Here is the caller graph for this function:

◆ getRemoteUserId()

ilECSRemoteUser::getRemoteUserId ( )

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

References $remote_usr_id.

Referenced by create(), and update().

105  {
106  return $this->remote_usr_id;
107  }
+ Here is the caller graph for this function:

◆ getServerId()

ilECSRemoteUser::getServerId ( )

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

References $sid.

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

74  {
75  return $this->sid;
76  }
+ Here is the caller graph for this function:

◆ getUserId()

ilECSRemoteUser::getUserId ( )

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

References $usr_id.

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

95  {
96  return $this->usr_id;
97  }
+ Here is the caller graph for this function:

◆ read()

ilECSRemoteUser::read ( )
protected

Read data set.

Returns
boolean

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

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

Referenced by __construct().

147  {
148  if (!$this->getId()) {
149  return false;
150  }
151 
152  $query = 'SELECT * FROM ecs_remote_user ' .
153  'WHERE eru_id = ' . $GLOBALS['ilDB']->quote($this->getId(), 'integer');
154  $res = $GLOBALS['ilDB']->query($query);
155  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
156  $this->setServerId($row->sid);
157  $this->setMid($row->mid);
158  $this->setUserId($row->usr_id);
159  $this->setRemoteUserId($row->remote_usr_id);
160  }
161  }
setRemoteUserId($a_remote_id)
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
foreach($_POST as $key=> $value) $res
$query
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setMid()

ilECSRemoteUser::setMid (   $a_mid)

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

Referenced by read().

79  {
80  $this->mid = $a_mid;
81  }
+ Here is the caller graph for this function:

◆ setRemoteUserId()

ilECSRemoteUser::setRemoteUserId (   $a_remote_id)

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

Referenced by read().

100  {
101  $this->remote_usr_id = $a_remote_id;
102  }
+ Here is the caller graph for this function:

◆ setServerId()

ilECSRemoteUser::setServerId (   $a_sid)

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

Referenced by read().

69  {
70  $this->sid = $a_sid;
71  }
+ Here is the caller graph for this function:

◆ setUserId()

ilECSRemoteUser::setUserId (   $a_usr_id)

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

Referenced by read().

90  {
91  $this->usr_id = $a_usr_id;
92  }
+ Here is the caller graph for this function:

◆ update()

ilECSRemoteUser::update ( )

Update remote user entry.

Returns
boolean

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

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

114  {
115  $query = 'UPDATE ecs_remote_user SET ' .
116  'sid = ' . $GLOBALS['ilDB']->quote($this->getServerId(), 'integer') . ', ' .
117  'mid = ' . $GLOBALS['ilDB']->quote($this->getMid(), 'integer') . ', ' .
118  'usr_id = ' . $GLOBALS['ilDB']->quote($this->getUserId(), 'text') . ', ' .
119  'remote_usr_id = ' . $GLOBALS['ilDB']->quote($this->getRemoteUserId(), 'text') . ' ' .
120  'WHERE eru_id = ' . $GLOBALS['ilDB']->quote($this->getId());
121  $GLOBALS['ilDB']->manipulate($query);
122  return true;
123  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
$query
+ Here is the call graph for this function:

Field Documentation

◆ $eru_id

ilECSRemoteUser::$eru_id = 0
private

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

Referenced by getId().

◆ $mid

ilECSRemoteUser::$mid = 0
private

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

Referenced by getMid().

◆ $remote_usr_id

ilECSRemoteUser::$remote_usr_id = ''
private

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

Referenced by getRemoteUserId().

◆ $sid

ilECSRemoteUser::$sid = 0
private

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

Referenced by getServerId().

◆ $usr_id

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: