ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
class.ilObjBibliographicStakeholder.php
Go to the documentation of this file.
1 <?php
2 
21 
27 {
29 
33  public function getId(): string
34  {
35  return 'bibl';
36  }
37 
38  public function getOwnerOfNewResources(): int
39  {
40  return $this->default_owner;
41  }
42 
43  public function getLocationURIForResourceUsage(ResourceIdentification $identification): ?string
44  {
45  $this->initDB();
46 
47  $r = $this->database->query(
48  "SELECT id FROM il_bibl_data WHERE rid = " . $this->database->quote($identification->serialize(), 'text')
49  );
50  $d = $this->database->fetchObject($r);
51  if (isset($d->id)) {
52  $references = ilObject::_getAllReferences($d->id);
53  $ref_id = array_shift($references);
54 
55  return ilLink::_getLink($ref_id, 'bibl');
56  }
57  return null;
58  }
59 
60  private function initDB(): void
61  {
62  global $DIC;
63  $this->database = $DIC->database();
64  }
65 }
static _getAllReferences(int $id)
get all reference ids for object ID
getLocationURIForResourceUsage(ResourceIdentification $identification)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
$ref_id
Definition: ltiauth.php:65
Class ilObjBibliographicStakeholder.
global $DIC
Definition: shib_login.php:22
$r