ILIAS  trunk Revision v11.0_alpha-1744-gb0451eebef4
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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.

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

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

References getConsumerId().

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  }
+ Here is the call graph for this function:

◆ getAdminRole()

ilLTIProviderObjectSetting::getAdminRole ( )

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

References $admin.

Referenced by save().

64  : int
65  {
66  return $this->admin;
67  }
+ 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().

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

◆ getMemberRole()

ilLTIProviderObjectSetting::getMemberRole ( )

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

References $member.

Referenced by save().

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

◆ getTutorRole()

ilLTIProviderObjectSetting::getTutorRole ( )

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

References $tutor.

Referenced by save().

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

◆ read()

ilLTIProviderObjectSetting::read ( )
protected

Read object settings.

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

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

Referenced by __construct().

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->admin = (int) $row->admin;
147  $this->tutor = (int) $row->tutor;
148  $this->member = (int) $row->member;
149  }
150  return true;
151  }
$res
Definition: ltiservices.php:66
+ 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.

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

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

◆ 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  }

◆ setTutorRole()

ilLTIProviderObjectSetting::setTutorRole ( int  $a_role)

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

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

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: