ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
◀ ilDoc Overview
class.ilLTIProviderObjectSetting.php
Go to the documentation of this file.
1
<?php
2
3
/* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
4
11
class
ilLTIProviderObjectSetting
12
{
16
private
$log
= null;
17
21
private
$db
= null;
22
23
private
$ref_id
= 0;
24
private
$consumer_id
= 0;
25
private
$admin
=
false
;
26
private
$tutor
=
false
;
27
private
$member
=
false
;
28
33
public
function
__construct
($a_ref_id, $a_ext_consumer_id)
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
}
45
46
47
public
function
setAdminRole
($a_role)
48
{
49
$this->admin = $a_role;
50
}
51
52
public
function
getAdminRole
()
53
{
54
return
$this->admin
;
55
}
56
57
public
function
setTutorRole
($a_role)
58
{
59
$this->tutor = $a_role;
60
}
61
62
public
function
getTutorRole
()
63
{
64
return
$this->tutor
;
65
}
66
67
public
function
setMemberRole
($a_role)
68
{
69
$this->member = $a_role;
70
}
71
72
public
function
getMemberRole
()
73
{
74
return
$this->member
;
75
}
76
81
public
function
setConsumerId
($a_consumer_id)
82
{
83
$this->consumer_id = $a_consumer_id;
84
}
85
86
public
function
getConsumerId
()
87
{
88
return
$this->consumer_id
;
89
}
90
91
95
public
function
delete
()
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
}
102
103
public
function
save
()
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
}
117
122
protected
function
read
()
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
}
141
}
ilLTIProviderObjectSetting\setMemberRole
setMemberRole($a_role)
Definition:
class.ilLTIProviderObjectSetting.php:67
ilLTIProviderObjectSetting\setAdminRole
setAdminRole($a_role)
Definition:
class.ilLTIProviderObjectSetting.php:47
$DIC
global $DIC
Definition:
saml.php:7
ilLTIProviderObjectSetting\setConsumerId
setConsumerId($a_consumer_id)
Set consumer id.
Definition:
class.ilLTIProviderObjectSetting.php:81
ilLTIProviderObjectSetting\$member
$member
Definition:
class.ilLTIProviderObjectSetting.php:27
ilLTIProviderObjectSetting
Stores.
Definition:
class.ilLTIProviderObjectSetting.php:11
ilLTIProviderObjectSetting\getConsumerId
getConsumerId()
Definition:
class.ilLTIProviderObjectSetting.php:86
ilLTIProviderObjectSetting\getMemberRole
getMemberRole()
Definition:
class.ilLTIProviderObjectSetting.php:72
ilLTIProviderObjectSetting\$db
$db
Definition:
class.ilLTIProviderObjectSetting.php:21
ilLTIProviderObjectSetting\$log
$log
Definition:
class.ilLTIProviderObjectSetting.php:16
ilLTIProviderObjectSetting\$tutor
$tutor
Definition:
class.ilLTIProviderObjectSetting.php:26
ilLTIProviderObjectSetting\$consumer_id
$consumer_id
Definition:
class.ilLTIProviderObjectSetting.php:24
ilLTIProviderObjectSetting\save
save()
Definition:
class.ilLTIProviderObjectSetting.php:103
$res
foreach($_POST as $key=> $value) $res
Definition:
save_question_post_data.php:15
$query
$query
Definition:
proxy_ylocal.php:13
ilLTIProviderObjectSetting\getTutorRole
getTutorRole()
Definition:
class.ilLTIProviderObjectSetting.php:62
ilLTIProviderObjectSetting\read
read()
Read object settings.
Definition:
class.ilLTIProviderObjectSetting.php:122
ilLTIProviderObjectSetting\getAdminRole
getAdminRole()
Definition:
class.ilLTIProviderObjectSetting.php:52
ilLTIProviderObjectSetting\setTutorRole
setTutorRole($a_role)
Definition:
class.ilLTIProviderObjectSetting.php:57
ilLTIProviderObjectSetting\__construct
__construct($a_ref_id, $a_ext_consumer_id)
Constructor type $DIC.
Definition:
class.ilLTIProviderObjectSetting.php:33
$row
$row
Definition:
10autofilter-selection-1.php:74
ilLTIProviderObjectSetting\$admin
$admin
Definition:
class.ilLTIProviderObjectSetting.php:25
ilLTIProviderObjectSetting\$ref_id
$ref_id
Definition:
class.ilLTIProviderObjectSetting.php:23
Services
LTI
classes
InternalProvider
class.ilLTIProviderObjectSetting.php
Generated on Tue Jan 28 2025 19:01:36 for ILIAS by
1.8.13 (using
Doxyfile
)