19declare(strict_types=1);
29 public function __construct(
int $a_id = 0,
bool $a_call_by_reference =
true)
41 return $obj_def->getLTIProviderTypes();
51 $global_roles = $rbacreview->getGlobalRoles();
56 foreach ($filtered_roles as $role) {
58 $roles[$role] = $obj_role->getTitle();
70 $this->db->manipulate(
"DELETE FROM lti_ext_consumer_otype WHERE consumer_id = " . $this->db->quote($a_consumer_id,
"integer"));
73 $query =
"INSERT INTO lti_ext_consumer_otype (consumer_id, object_type) VALUES (%s, %s)";
74 $types = array(
"integer",
"text");
75 foreach ($a_obj_types as $ot) {
76 $values = array($a_consumer_id, $ot);
77 $this->db->manipulateF($query, $types, $values);
90 $result =
$ilDB->query(
"SELECT object_type FROM lti_ext_consumer_otype WHERE consumer_id = " .
$ilDB->quote($a_consumer_id,
"integer"));
93 while ($record =
$ilDB->fetchAssoc($result)) {
94 $obj_ids[] = $record[
'object_type'];
102 public static function isEnabledForType(
string $a_type): bool
109 $query =
'select id from lti_ext_consumer join lti_ext_consumer_otype on id = consumer_id ' .
110 'WHERE active = ' .
$db->
quote(1,
'integer') .
' ' .
111 'AND object_type = ' .
$db->
quote($a_type,
'text');
113 while ($row =
$res->fetchObject()) {
124 public static function getEnabledConsumersForType(
string $a_type): array
131 $query =
'select distinct(id) id from lti_ext_consumer join lti_ext_consumer_otype on id = consumer_id ' .
132 'WHERE active = ' .
$db->
quote(1,
'integer') .
' ' .
133 'AND object_type = ' .
$db->
quote($a_type,
'text');
137 $consumers = array();
138 while ($row =
$res->fetchObject()) {
152 SELECT object_reference.ref_id FROM object_reference, tree, object_data
153 WHERE tree.parent = %s
154 AND object_data.type = %s
155 AND object_reference.ref_id = tree.child
156 AND object_reference.obj_id = object_data.obj_id',
157 array(
'integer',
'text'),
161 $lti_ref_id = (
int) $row[
'ref_id'];
174 $query =
'select ref_id, title from lti2_consumer join lti_ext_consumer ' .
175 'on id = ext_consumer_id where enabled = ' .
$db->
quote(1,
'integer');
182 $item[
'ref_id'] = $row->ref_id;
183 $item[
'title'] = $row->title;
static getLogger(string $a_component_id)
Get component logger.
static lookupLTISettingsRefId()
Lookup ref_id.
static getActiveObjectTypes(int $a_consumer_id)
static readReleaseObjects()
Read released objects.
saveConsumerObjectTypes(int $a_consumer_id, array $a_obj_types)
__construct(int $a_id=0, bool $a_call_by_reference=true)
parses the objects.xml it handles the xml-description of all ilias objects
Class ilObject Basic functions for all objects.
quote($value, string $type)
query(string $query)
Run a (read-only) Query on the database.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc