19 declare(strict_types=1);
34 self::addPurpose($service, $purpose);
35 self::addPreferred($service, $purpose, $preferred);
41 $ilDB = $DIC->database();
44 self::PURPOSE_PURPOSES_TABLE,
46 'purpose_id' => [
'int',
$ilDB->nextId(self::PURPOSE_PURPOSES_TABLE)],
48 'purpose' => [
'text', $purpose],
56 $ilDB = $DIC->database();
58 self::PURPOSE_MAP_TABLE,
60 'map_id' => [
'int',
$ilDB->nextId(self::PURPOSE_MAP_TABLE)],
62 'purpose' => [
'text', $purpose],
63 'preferred' => [
'text', $preferred],
64 'selected' => [
'text', $preferred]
72 $ilDB = $DIC->database();
74 $ilDB->manipulate(
"DELETE FROM " . self::PURPOSE_PURPOSES_TABLE .
75 " WHERE service = " .
$ilDB->quote($service,
"text") .
" AND purpose = " .
$ilDB->quote($purpose,
"text"));
81 $ilDB = $DIC->database();
83 $ilDB->manipulate(
"DELETE FROM " . self::PURPOSE_MAP_TABLE .
84 " WHERE service = " .
$ilDB->quote($service,
"text") .
" AND purpose = " .
$ilDB->quote($purpose,
"text") .
85 " AND preferred = " .
$ilDB->quote($preferred,
"text"));
91 $ilDB = $DIC->database();
93 $ilDB->manipulate(
"DELETE FROM " . self::PURPOSE_PURPOSES_TABLE .
" WHERE service = " .
$ilDB->quote(
102 $ilDB = $DIC->database();
104 $query =
'SELECT count(*) num FROM ' . self::PURPOSE_PURPOSES_TABLE .
' WHERE service = ' 105 .
$ilDB->quote($service,
'text') .
' AND purpose = ' .
$ilDB->quote($purpose,
'text');
107 $row =
$ilDB->fetchAssoc($result);
109 return is_array($row) && (
int) $row[
'num'] !== 0;
119 $ilDB = $DIC->database();
121 $query =
'SELECT purpose FROM ' . self::PURPOSE_PURPOSES_TABLE .
' WHERE service = ' .
$ilDB->quote(
127 while ($row =
$ilDB->fetchAssoc($result)) {
128 $purposes[] = $row[
'purpose'];
139 $ilDB = $DIC->database();
141 $query =
'SELECT service FROM ' . self::PURPOSE_PURPOSES_TABLE .
' GROUP BY service';
144 while ($row =
$ilDB->fetchAssoc($result)) {
145 $services[] = $row[
'service'];
153 $ilDB = $DIC->database();
154 $query =
'SELECT service, purpose FROM ' . self::PURPOSE_PURPOSES_TABLE .
' GROUP BY service, purpose having count(*) > 1';
156 $row =
$ilDB->fetchAssoc($result);
158 return is_array($row) && !empty($row);
164 $ilDB = $DIC->database();
165 $query =
'SELECT service, purpose FROM ' . self::PURPOSE_PURPOSES_TABLE .
' GROUP BY service, purpose having count(*) > 1';
167 while ($row =
$ilDB->fetchAssoc($result)) {
168 self::unregisterPurpose($row[
'service'], $row[
'purpose']);
169 self::addPurpose($row[
'service'], $row[
'purpose']);
172 $query =
'SELECT service, purpose, preferred FROM ' . self::PURPOSE_MAP_TABLE .
' GROUP BY service, purpose, preferred having count(*) > 1';
175 while ($row =
$ilDB->fetchAssoc($result)) {
176 self::unregisterPreferred($row[
'service'], $row[
'purpose'], $row[
'preferred']);
177 self::addPreferred($row[
'service'], $row[
'purpose'], $row[
'preferred']);
183 $parts = explode(
'/', $service);
186 if (!self::isPurposeRegistered($service, $purpose)) {
187 self::registerPurpose($service, $purpose, $preferred);
194 $ilDB = $DIC->database();
197 self::RENDERER_TABLE,
199 'renderer_id' => [
'int',
$ilDB->nextId(self::RENDERER_TABLE)],
200 'renderer' => [
'text', $renderer],
201 'path' => [
'text',
$path]
209 $ilDB = $DIC->database();
212 self::RENDERER_AVAIL_TABLE,
214 'availability_id' => [
'int',
$ilDB->nextId(self::RENDERER_AVAIL_TABLE)],
216 'purpose' => [
'text', $purpose],
217 'renderer' => [
'text', $renderer]
static registerRenderer(string $renderer, string $path)
static unregisterPurpose(string $service, string $purpose)
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
static registerPurpose(string $service, string $purpose, string $preferred)
static unregisterPreferred(string $service, string $purpose, string $preferred)
static flushPurposes(string $service)
static getPurposesByService(string $service)
const PURPOSE_PURPOSES_TABLE
static updateFromXML(string $service, string $purpose, string $preferred)
static addPreferred(string $service, string $purpose, string $preferred)
const RENDERER_AVAIL_TABLE
static addPurpose(string $service, string $purpose)
static registerRendererAvailability(string $renderer, string $service, string $purpose)
static isPurposeRegistered(string $service, string $purpose)
static checkForMultipleServiceAndPurposeCombination()