ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilLTIProviderObjectSetting Class Reference

Stores. More...

+ Collaboration diagram for ilLTIProviderObjectSetting:

Public Member Functions

 __construct (int $a_ref_id, int $a_ext_consumer_id)
 Constructor. More...
 
 setAdminRole (int $a_role)
 
 getAdminRole ()
 
 setTutorRole (int $a_role)
 
 getTutorRole ()
 
 setMemberRole (int $a_role)
 
 getMemberRole ()
 
 setConsumerId (int $a_consumer_id)
 Set consumer id. More...
 
 getConsumerId ()
 
 delete ()
 Delete obj setting. More...
 
 save ()
 

Protected Member Functions

 read ()
 Read object settings. More...
 

Private Attributes

ilLogger $log = null
 
ilDBInterface $db = null
 
int $ref_id = 0
 
int $consumer_id = 0
 
int $admin = 0
 
int $tutor = 0
 
int $member = 0
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilLTIProviderObjectSetting::__construct ( int  $a_ref_id,
int  $a_ext_consumer_id 
)

Constructor.

Definition at line 42 of file class.ilLTIProviderObjectSetting.php.

43 {
44 global $DIC;
45
46 $this->log = ilLoggerFactory::getLogger('ltis');
47 $this->db = $DIC->database();
48
49 $this->ref_id = $a_ref_id;
50 $this->consumer_id = $a_ext_consumer_id;
51
52 $ok = $this->read();
53 if (!$ok) {
54 $this->log->warning("no ref_id set");
55 }
56 }
static getLogger(string $a_component_id)
Get component logger.
global $DIC
Definition: shib_login.php:26

References $DIC, ilLoggerFactory\getLogger(), and read().

+ Here is the call graph for this function:

Member Function Documentation

◆ delete()

ilLTIProviderObjectSetting::delete ( )

Delete obj setting.

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

106 : void
107 {
108 $query = 'DELETE FROM lti_int_provider_obj ' .
109 'WHERE ref_id = ' . $this->db->quote($this->ref_id, 'integer') . ' ' .
110 'AND ext_consumer_id = ' . $this->db->quote($this->getConsumerId(), 'integer');
111 $this->db->manipulate($query);
112 }

References getConsumerId().

+ Here is the call graph for this function:

◆ getAdminRole()

ilLTIProviderObjectSetting::getAdminRole ( )

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

References $admin.

Referenced by ilAuthProviderLTI\mapLTIRoleToLocalRole().

+ Here is the caller graph for this function:

◆ getConsumerId()

ilLTIProviderObjectSetting::getConsumerId ( )

Definition at line 97 of file class.ilLTIProviderObjectSetting.php.

References $consumer_id.

Referenced by delete(), read(), and save().

+ Here is the caller graph for this function:

◆ getMemberRole()

ilLTIProviderObjectSetting::getMemberRole ( )

Definition at line 84 of file class.ilLTIProviderObjectSetting.php.

References $member.

Referenced by ilAuthProviderLTI\mapLTIRoleToLocalRole().

+ Here is the caller graph for this function:

◆ getTutorRole()

ilLTIProviderObjectSetting::getTutorRole ( )

Definition at line 74 of file class.ilLTIProviderObjectSetting.php.

References $tutor.

Referenced by ilAuthProviderLTI\mapLTIRoleToLocalRole().

+ Here is the caller graph for this function:

◆ read()

ilLTIProviderObjectSetting::read ( )
protected

Read object settings.

Definition at line 132 of file class.ilLTIProviderObjectSetting.php.

132 : bool
133 {
134 if (!$this->ref_id) {
135 return false;
136 }
137
138 $query = 'SELECT * FROM lti_int_provider_obj ' .
139 'WHERE ref_id = ' . $this->db->quote($this->ref_id, 'integer') . ' ' .
140 'AND ext_consumer_id = ' . $this->db->quote($this->getConsumerId(), 'integer');
141
142 $res = $this->db->query($query);
143 while ($row = $res->fetchObject()) {
144 $this->ref_id = (int) $row->ref_id;
145 $this->consumer_id = (int) $row->ext_consumer_id;
146 $this->setAdminRole((int) $row->admin);
147 $this->setTutorRole((int) $row->tutor);
148 $this->setMemberRole((int) $row->member);
149 }
150 return true;
151 }
$res
Definition: ltiservices.php:69

References $res, getConsumerId(), ILIAS\Repository\int(), setAdminRole(), setMemberRole(), and setTutorRole().

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

ilLTIProviderObjectSetting::save ( )

Definition at line 114 of file class.ilLTIProviderObjectSetting.php.

114 : void
115 {
116 $this->delete();
117
118 $query = 'INSERT INTO lti_int_provider_obj ' .
119 '(ref_id,ext_consumer_id,admin,tutor,member) VALUES( ' .
120 $this->db->quote($this->ref_id, 'integer') . ', ' .
121 $this->db->quote($this->getConsumerId(), 'integer') . ', ' .
122 $this->db->quote($this->getAdminRole(), 'integer') . ', ' .
123 $this->db->quote($this->getTutorRole(), 'integer') . ', ' .
124 $this->db->quote($this->getMemberRole(), 'integer') .
125 ' )';
126 $this->db->manipulate($query);
127 }

References getConsumerId().

+ Here is the call graph for this function:

◆ setAdminRole()

ilLTIProviderObjectSetting::setAdminRole ( int  $a_role)

Definition at line 59 of file class.ilLTIProviderObjectSetting.php.

59 : void
60 {
61 $this->admin = $a_role;
62 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setConsumerId()

ilLTIProviderObjectSetting::setConsumerId ( int  $a_consumer_id)

Set consumer id.

Definition at line 92 of file class.ilLTIProviderObjectSetting.php.

92 : void
93 {
94 $this->consumer_id = $a_consumer_id;
95 }

◆ setMemberRole()

ilLTIProviderObjectSetting::setMemberRole ( int  $a_role)

Definition at line 79 of file class.ilLTIProviderObjectSetting.php.

79 : void
80 {
81 $this->member = $a_role;
82 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setTutorRole()

ilLTIProviderObjectSetting::setTutorRole ( int  $a_role)

Definition at line 69 of file class.ilLTIProviderObjectSetting.php.

69 : void
70 {
71 $this->tutor = $a_role;
72 }

Referenced by read().

+ Here is the caller graph for this function:

Field Documentation

◆ $admin

int ilLTIProviderObjectSetting::$admin = 0
private

Definition at line 35 of file class.ilLTIProviderObjectSetting.php.

Referenced by getAdminRole().

◆ $consumer_id

int ilLTIProviderObjectSetting::$consumer_id = 0
private

Definition at line 34 of file class.ilLTIProviderObjectSetting.php.

Referenced by getConsumerId().

◆ $db

ilDBInterface ilLTIProviderObjectSetting::$db = null
private

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

◆ $log

ilLogger ilLTIProviderObjectSetting::$log = null
private

Definition at line 29 of file class.ilLTIProviderObjectSetting.php.

◆ $member

int ilLTIProviderObjectSetting::$member = 0
private

Definition at line 37 of file class.ilLTIProviderObjectSetting.php.

Referenced by getMemberRole().

◆ $ref_id

int ilLTIProviderObjectSetting::$ref_id = 0
private

Definition at line 33 of file class.ilLTIProviderObjectSetting.php.

◆ $tutor

int ilLTIProviderObjectSetting::$tutor = 0
private

Definition at line 36 of file class.ilLTIProviderObjectSetting.php.

Referenced by getTutorRole().


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