ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f87
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 130 of file class.ilECSRemoteUser.php.

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

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

◆ exists()

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().

49  {
50  global $ilDB;
51 
52  $query = 'SELECT eru_id FROM ecs_remote_user '.
53  'WHERE sid = '.$ilDB->quote($this->getServerId(),'integer').' '.
54  'AND mid = '.$ilDB->quote($this->getMid(),'integer').' '.
55  'AND usr_id = '.$ilDB->quote($this->getUserId(),'integer');
56  $res = $ilDB->query($query);
57  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
58  {
59  return (bool) $row->eru_id;
60  }
61  return false;
62  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
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 DB_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(DB_FETCHMODE_OBJECT))
39  {
40  return new self($row->eru_id);
41  }
42  return null;
43  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
global $ilDB
+ Here is the caller graph for this function:

◆ getId()

ilECSRemoteUser::getId ( )

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

References $eru_id.

Referenced by read(), and update().

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

◆ getMid()

ilECSRemoteUser::getMid ( )

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

References $mid.

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

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

◆ getRemoteUserId()

ilECSRemoteUser::getRemoteUserId ( )

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

References $remote_usr_id.

Referenced by create(), and update().

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

◆ getServerId()

ilECSRemoteUser::getServerId ( )

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

References $sid.

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

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

◆ getUserId()

ilECSRemoteUser::getUserId ( )

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

References $usr_id.

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

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

◆ read()

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().

150  {
151  if(!$this->getId())
152  {
153  return false;
154  }
155 
156  $query = 'SELECT * FROM ecs_remote_user '.
157  'WHERE eru_id = '.$GLOBALS['ilDB']->quote($this->getId(),'integer');
158  $res = $GLOBALS['ilDB']->query($query);
159  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
160  {
161  $this->setServerId($row->sid);
162  $this->setMid($row->mid);
163  $this->setUserId($row->usr_id);
164  $this->setRemoteUserId($row->remote_usr_id);
165  }
166  }
setRemoteUserId($a_remote_id)
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
$GLOBALS['ct_recipient']
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setMid()

ilECSRemoteUser::setMid (   $a_mid)

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

Referenced by read().

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

◆ setRemoteUserId()

ilECSRemoteUser::setRemoteUserId (   $a_remote_id)

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

Referenced by read().

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

◆ setServerId()

ilECSRemoteUser::setServerId (   $a_sid)

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

Referenced by read().

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

◆ setUserId()

ilECSRemoteUser::setUserId (   $a_usr_id)

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

Referenced by read().

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

◆ update()

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().

116  {
117  $query = 'UPDATE ecs_remote_user SET '.
118  'sid = '.$GLOBALS['ilDB']->quote($this->getServerId(),'integer').', '.
119  'mid = '.$GLOBALS['ilDB']->quote($this->getMid(),'integer').', '.
120  'usr_id = '.$GLOBALS['ilDB']->quote($this->getUserId(),'text').', '.
121  'remote_usr_id = '.$GLOBALS['ilDB']->quote($this->getRemoteUserId(),'text').' '.
122  'WHERE eru_id = '.$GLOBALS['ilDB']->quote($this->getId());
123  $GLOBALS['ilDB']->manipulate($query);
124  return true;
125  }
$GLOBALS['ct_recipient']
+ 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: