ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
class.ilObjBibliographicStakeholder.php
Go to the documentation of this file.
1 <?php
2 
21 
27 {
28  protected ?ilDBInterface $database = null;
29 
30  public function __construct()
31  {
32  }
33 
37  public function getId(): string
38  {
39  return 'bibl';
40  }
41 
45  public function getOwnerOfNewResources(): int
46  {
47  return 6;
48  }
49 
50  public function getLocationURIForResourceUsage(ResourceIdentification $identification): ?string
51  {
52  $this->initDB();
53 
54  $r = $this->database->query(
55  "SELECT id FROM il_bibl_data WHERE rid = " . $this->database->quote($identification->serialize(), 'text')
56  );
57  $d = $this->database->fetchObject($r);
58  if (isset($d->id)) {
59  $references = ilObject::_getAllReferences($d->id);
60  $ref_id = array_shift($references);
61 
62  return ilLink::_getLink($ref_id, 'bibl');
63  }
64  return null;
65  }
66 
67  private function initDB(): void
68  {
69  global $DIC;
70  $this->database = $DIC->database();
71  }
72 }
static _getAllReferences(int $id)
get all reference ids for object ID
getLocationURIForResourceUsage(ResourceIdentification $identification)
global $DIC
Definition: feed.php:28
$ref_id
Definition: ltiauth.php:67
Class ilObjBibliographicStakeholder.
__construct()
Constructor must not have any parameters.
$r