ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilBookBookingInfoStakeholder Class Reference
+ Inheritance diagram for ilBookBookingInfoStakeholder:
+ Collaboration diagram for ilBookBookingInfoStakeholder:

Public Member Functions

 getId ()
 
 getOwnerOfNewResources ()
 
 canBeAccessedByCurrentUser (ResourceIdentification $identification)
 
 resourceHasBeenDeleted (ResourceIdentification $identification)
 
 getLocationURIForResourceUsage (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...
 

Protected Attributes

ilDBInterface $database = null
 
- Protected Attributes inherited from ILIAS\ResourceStorage\Stakeholder\AbstractResourceStakeholder
int $default_owner
 
int $current_user
 

Private Member Functions

 resolveObjectId (ResourceIdentification $identification)
 
 initDB ()
 

Detailed Description

Definition at line 22 of file class.ilBookBookingInfoStakeholder.php.

Member Function Documentation

◆ canBeAccessedByCurrentUser()

ilBookBookingInfoStakeholder::canBeAccessedByCurrentUser ( ResourceIdentification  $identification)

Implements ILIAS\ResourceStorage\Stakeholder\ResourceStakeholder.

Definition at line 36 of file class.ilBookBookingInfoStakeholder.php.

References $DIC, $ref_id, ilObject\_getAllReferences(), null, and resolveObjectId().

36  : bool
37  {
38  global $DIC;
39 
40  $object_id = $this->resolveObjectId($identification);
41  if ($object_id === null) {
42  return true;
43  }
44 
45  $ref_ids = ilObject2::_getAllReferences($object_id);
46  foreach ($ref_ids as $ref_id) {
47  // one must have read permissions on the exercise to see the instruction files
48  if ($DIC->access()->checkAccessOfUser($this->current_user, 'read', '', $ref_id)) {
49  return true;
50  }
51  }
52 
53  return false;
54  }
static _getAllReferences(int $id)
get all reference ids for object ID
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
$ref_id
Definition: ltiauth.php:65
global $DIC
Definition: shib_login.php:22
resolveObjectId(ResourceIdentification $identification)
+ Here is the call graph for this function:

◆ getId()

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

Implements ILIAS\ResourceStorage\Stakeholder\ResourceStakeholder.

Definition at line 26 of file class.ilBookBookingInfoStakeholder.php.

26  : string
27  {
28  return 'book_booking_info';
29  }

◆ getLocationURIForResourceUsage()

ilBookBookingInfoStakeholder::getLocationURIForResourceUsage ( ResourceIdentification  $identification)

Implements ILIAS\ResourceStorage\Stakeholder\ResourceStakeholder.

Definition at line 63 of file class.ilBookBookingInfoStakeholder.php.

References $ref_id, ilObject\_getAllReferences(), initDB(), null, and resolveObjectId().

63  : ?string
64  {
65  $this->initDB();
66  $object_id = $this->resolveObjectId($identification);
67  if ($object_id !== null) {
68  $references = ilObject::_getAllReferences($object_id);
69  $ref_id = array_shift($references);
70 
71  // we currently deliver the goto-url of the exercise in which the resource is used. if possible, you could deliver a more speficic url wo the assignment as well.
72  return ilLink::_getLink($ref_id, 'exc');
73  }
74  return null;
75  }
static _getAllReferences(int $id)
get all reference ids for object ID
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
$ref_id
Definition: ltiauth.php:65
resolveObjectId(ResourceIdentification $identification)
+ Here is the call graph for this function:

◆ getOwnerOfNewResources()

◆ initDB()

ilBookBookingInfoStakeholder::initDB ( )
private

Definition at line 90 of file class.ilBookBookingInfoStakeholder.php.

References $DIC, and null.

Referenced by getLocationURIForResourceUsage(), and resolveObjectId().

90  : void
91  {
92  global $DIC;
93  if ($this->database === null) {
94  $this->database = $DIC->database();
95  }
96  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
global $DIC
Definition: shib_login.php:22
+ Here is the caller graph for this function:

◆ resolveObjectId()

ilBookBookingInfoStakeholder::resolveObjectId ( ResourceIdentification  $identification)
private

Definition at line 77 of file class.ilBookBookingInfoStakeholder.php.

References Vendor\Package\$d, $r, initDB(), null, and ILIAS\ResourceStorage\Identification\AbstractIdentification\serialize().

Referenced by canBeAccessedByCurrentUser(), and getLocationURIForResourceUsage().

77  : ?int
78  {
79  $this->initDB();
80  $r = $this->database->queryF(
81  "SELECT pool_id FROM booking_object WHERE booking_object.book_info_rid = %s;",
82  ['text'],
83  [$identification->serialize()]
84  );
85  $d = $this->database->fetchObject($r);
86 
87  return (isset($d->pool_id) ? (int) $d->pool_id : null);
88  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
$r
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resourceHasBeenDeleted()

ilBookBookingInfoStakeholder::resourceHasBeenDeleted ( ResourceIdentification  $identification)
Returns
bool true: if the Stakeholder could handle the deletion; false: if the Stakeholder could not handle the deletion of the resource.

Implements ILIAS\ResourceStorage\Stakeholder\ResourceStakeholder.

Definition at line 56 of file class.ilBookBookingInfoStakeholder.php.

56  : bool
57  {
58  // at this place we could handle de deletion of a resource. not needed for instruction files IMO.
59 
60  return true;
61  }

Field Documentation

◆ $database

ilDBInterface ilBookBookingInfoStakeholder::$database = null
protected

Definition at line 24 of file class.ilBookBookingInfoStakeholder.php.


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