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.

21 {
22 $this->eru_id = $a_eru_id;
23 $this->read();
24 }

References read().

+ 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.

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

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

+ 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.

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
global $ilDB

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

+ 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
\self|null

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

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 }

References $ilDB, $query, $res, $row, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilECSAppEventListener\updateEnrolmentStatus().

+ Here is the caller graph for this function:

◆ getId()

ilECSRemoteUser::getId ( )

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

64 {
65 return $this->eru_id;
66 }

References $eru_id.

Referenced by read(), and update().

+ Here is the caller graph for this function:

◆ getMid()

ilECSRemoteUser::getMid ( )

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

84 {
85 return $this->mid;
86 }

References $mid.

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

+ Here is the caller graph for this function:

◆ getRemoteUserId()

ilECSRemoteUser::getRemoteUserId ( )

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

105 {
107 }

References $remote_usr_id.

Referenced by create(), and update().

+ Here is the caller graph for this function:

◆ getServerId()

ilECSRemoteUser::getServerId ( )

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

74 {
75 return $this->sid;
76 }

References $sid.

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

+ Here is the caller graph for this function:

◆ getUserId()

ilECSRemoteUser::getUserId ( )

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

95 {
96 return $this->usr_id;
97 }

References $usr_id.

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

+ 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.

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)

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

Referenced by __construct().

+ 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.

79 {
80 $this->mid = $a_mid;
81 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setRemoteUserId()

ilECSRemoteUser::setRemoteUserId (   $a_remote_id)

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

100 {
101 $this->remote_usr_id = $a_remote_id;
102 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setServerId()

ilECSRemoteUser::setServerId (   $a_sid)

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

69 {
70 $this->sid = $a_sid;
71 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setUserId()

ilECSRemoteUser::setUserId (   $a_usr_id)

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

90 {
91 $this->usr_id = $a_usr_id;
92 }

Referenced by read().

+ 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.

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 }

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

+ 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: