ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilHTLMStakeholder Class Reference
+ Inheritance diagram for ilHTLMStakeholder:
+ Collaboration diagram for ilHTLMStakeholder:

Public Member Functions

 getId ()
 
 getOwnerOfNewResources ()
 
 getLocationURIForResourceUsage (ResourceIdentification $identification)
 
 isResourceInUse (ResourceIdentification $identification)
 
- Public Member Functions inherited from ILIAS\ResourceStorage\Stakeholder\AbstractResourceStakeholder
 __construct (?int $user_id_of_owner=null)
 
 setOwner (int $user_id_of_owner)
 
 getFullyQualifiedClassName ()
 
 isResourceInUse (ResourceIdentification $identification)
 
 canBeAccessedByCurrentUser (ResourceIdentification $identification)
 
 resourceHasBeenDeleted (ResourceIdentification $identification)
 
 getOwnerOfResource (ResourceIdentification $identification)
 
 getConsumerNameForPresentation ()
 
 getLocationURIForResourceUsage (ResourceIdentification $identification)
 
- Public Member Functions inherited from ILIAS\ResourceStorage\Stakeholder\ResourceStakeholder
 __construct ()
 Constructor must not have any parameters. More...
 
 getId ()
 
 getConsumerNameForPresentation ()
 
 getFullyQualifiedClassName ()
 
 canBeAccessedByCurrentUser (ResourceIdentification $identification)
 
 isResourceInUse (ResourceIdentification $identification)
 
 resourceHasBeenDeleted (ResourceIdentification $identification)
 
 getOwnerOfResource (ResourceIdentification $identification)
 
 getOwnerOfNewResources ()
 
 getLocationURIForResourceUsage (ResourceIdentification $identification)
 

Private Member Functions

 resolveDB ()
 

Additional Inherited Members

- Protected Attributes inherited from ILIAS\ResourceStorage\Stakeholder\AbstractResourceStakeholder
int $default_owner
 
int $current_user
 

Detailed Description

Member Function Documentation

◆ getId()

ilHTLMStakeholder::getId ( )
Returns
string not longer than 64 characters

Implements ILIAS\ResourceStorage\Stakeholder\ResourceStakeholder.

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

27 : string
28 {
29 return 'htlm';
30 }

◆ getLocationURIForResourceUsage()

ilHTLMStakeholder::getLocationURIForResourceUsage ( ResourceIdentification  $identification)

Reimplemented from ILIAS\ResourceStorage\Stakeholder\AbstractResourceStakeholder.

Definition at line 37 of file class.ilHTLMStakeholder.php.

37 : ?string
38 {
39 $db = $this->resolveDB();
40 if ($db === null) {
41 return null;
42 }
43 $res = $db->queryF(
44 'SELECT ref_id FROM file_based_lm
45 JOIN object_reference ON file_based_lm.id = object_reference.obj_id
46 WHERE rid = %s',
47 ['text'],
48 [$identification->serialize()]
49 );
50 if ($row = $db->fetchAssoc($res)) {
51 return ilLink::_getStaticLink((int) $row['ref_id']);
52 }
53 }
$res
Definition: ltiservices.php:69

References $res, ilLink\_getStaticLink(), resolveDB(), and ILIAS\ResourceStorage\Identification\AbstractIdentification\serialize().

+ Here is the call graph for this function:

◆ getOwnerOfNewResources()

◆ isResourceInUse()

ilHTLMStakeholder::isResourceInUse ( ResourceIdentification  $identification)

Reimplemented from ILIAS\ResourceStorage\Stakeholder\AbstractResourceStakeholder.

Definition at line 55 of file class.ilHTLMStakeholder.php.

55 : bool
56 {
57 $db = $this->resolveDB();
58 if ($db === null) {
59 return true; // we assume it is in use
60 }
61 $res = $db->queryF(
62 'SELECT ref_id FROM file_based_lm WHERE rid = %s',
63 ['text'],
64 [$identification->serialize()]
65 );
66 return $db->numRows($res) > 0;
67 }

References $res, resolveDB(), and ILIAS\ResourceStorage\Identification\AbstractIdentification\serialize().

+ Here is the call graph for this function:

◆ resolveDB()

ilHTLMStakeholder::resolveDB ( )
private

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

70 {
71 global $DIC;
72 if ($DIC->isDependencyAvailable('database')) {
73 return $DIC->database();
74 }
75 return null;
76 }
Interface ilDBInterface.
global $DIC
Definition: shib_login.php:26

References $DIC.

Referenced by getLocationURIForResourceUsage(), and isResourceInUse().

+ Here is the caller graph for this function:

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