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

Stores. More...

+ Collaboration diagram for ilLTIProviderObjectSetting:

Public Member Functions

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

Protected Member Functions

 read ()
 Read object settings. More...
 

Private Attributes

 $log = null
 
 $db = null
 
 $ref_id = 0
 
 $consumer_id = 0
 
 $admin = false
 
 $tutor = false
 
 $member = false
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilLTIProviderObjectSetting::__construct (   $a_ref_id,
  $a_ext_consumer_id 
)

Constructor type $DIC.

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

References $DIC, and read().

34  {
35  global $DIC;
36 
37  $this->log = $DIC->logger()->lti();
38  $this->db = $DIC->database();
39 
40  $this->ref_id = $a_ref_id;
41  $this->consumer_id = $a_ext_consumer_id;
42 
43  $this->read();
44  }
global $DIC
Definition: saml.php:7
+ Here is the call graph for this function:

Member Function Documentation

◆ delete()

ilLTIProviderObjectSetting::delete ( )

Delete obj setting.

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

References $query, and getConsumerId().

96  {
97  $query = 'DELETE FROM lti_int_provider_obj ' .
98  'WHERE ref_id = ' . $this->db->quote($this->ref_id, 'integer') . ' ' .
99  'AND ext_consumer_id = ' . $this->db->quote($this->getConsumerId(), 'integer');
100  $this->db->manipulate($query);
101  }
$query
+ Here is the call graph for this function:

◆ getAdminRole()

ilLTIProviderObjectSetting::getAdminRole ( )

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

References $admin.

Referenced by save().

+ Here is the caller graph for this function:

◆ getConsumerId()

ilLTIProviderObjectSetting::getConsumerId ( )

Definition at line 86 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 72 of file class.ilLTIProviderObjectSetting.php.

References $member.

Referenced by save().

+ Here is the caller graph for this function:

◆ getTutorRole()

ilLTIProviderObjectSetting::getTutorRole ( )

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

References $tutor.

Referenced by save().

+ Here is the caller graph for this function:

◆ read()

ilLTIProviderObjectSetting::read ( )
protected

Read object settings.

Returns
boolean

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

References $query, $res, $row, and getConsumerId().

Referenced by __construct().

123  {
124  if (!$this->ref_id) {
125  return false;
126  }
127 
128  $query = 'SELECT * FROM lti_int_provider_obj ' .
129  'WHERE ref_id = ' . $this->db->quote($this->ref_id, 'integer') . ' ' .
130  'AND ext_consumer_id = ' . $this->db->quote($this->getConsumerId(), 'integer');
131 
132  $res = $this->db->query($query);
133  while ($row = $res->fetchObject()) {
134  $this->ref_id = $row->ref_id;
135  $this->consumer_id = $row->ext_consumer_id;
136  $this->admin = $row->admin;
137  $this->tutor = $row->tutor;
138  $this->member = $row->member;
139  }
140  }
foreach($_POST as $key=> $value) $res
$query
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

ilLTIProviderObjectSetting::save ( )

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

References $query, getAdminRole(), getConsumerId(), getMemberRole(), and getTutorRole().

104  {
105  $this->delete();
106 
107  $query = 'INSERT INTO lti_int_provider_obj ' .
108  '(ref_id,ext_consumer_id,admin,tutor,member) VALUES( ' .
109  $this->db->quote($this->ref_id, 'integer') . ', ' .
110  $this->db->quote($this->getConsumerId(), 'integer') . ', ' .
111  $this->db->quote($this->getAdminRole(), 'integer') . ', ' .
112  $this->db->quote($this->getTutorRole(), 'integer') . ', ' .
113  $this->db->quote($this->getMemberRole(), 'integer') .
114  ' )';
115  $this->db->manipulate($query);
116  }
$query
+ Here is the call graph for this function:

◆ setAdminRole()

ilLTIProviderObjectSetting::setAdminRole (   $a_role)

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

48  {
49  $this->admin = $a_role;
50  }

◆ setConsumerId()

ilLTIProviderObjectSetting::setConsumerId (   $a_consumer_id)

Set consumer id.

Parameters
int$a_consumer_id

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

82  {
83  $this->consumer_id = $a_consumer_id;
84  }

◆ setMemberRole()

ilLTIProviderObjectSetting::setMemberRole (   $a_role)

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

68  {
69  $this->member = $a_role;
70  }

◆ setTutorRole()

ilLTIProviderObjectSetting::setTutorRole (   $a_role)

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

58  {
59  $this->tutor = $a_role;
60  }

Field Documentation

◆ $admin

ilLTIProviderObjectSetting::$admin = false
private

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

Referenced by getAdminRole().

◆ $consumer_id

ilLTIProviderObjectSetting::$consumer_id = 0
private

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

Referenced by getConsumerId().

◆ $db

ilLTIProviderObjectSetting::$db = null
private

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

◆ $log

ilLTIProviderObjectSetting::$log = null
private

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

◆ $member

ilLTIProviderObjectSetting::$member = false
private

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

Referenced by getMemberRole().

◆ $ref_id

ilLTIProviderObjectSetting::$ref_id = 0
private

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

◆ $tutor

ilLTIProviderObjectSetting::$tutor = false
private

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

Referenced by getTutorRole().


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