ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ObjectId.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS\Data;
22
23use ilObject2;
24
33{
34 private int $object_id;
35
39 public function __construct(int $object_id)
40 {
41 $this->object_id = $object_id;
42 }
43
44 public function toInt(): int
45 {
46 return $this->object_id;
47 }
48
52 public function toReferenceIds(): array
53 {
54 $ref_ids = [];
55 foreach (ilObject2::_getAllReferences($this->object_id) as $reference) {
56 $ref_ids[] = new ReferenceId((int) $reference);
57 }
58
59 return $ref_ids;
60 }
61}
__construct(int $object_id)
ReferenceId constructor.
Definition: ObjectId.php:39
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getAllReferences(int $id)
get all reference ids for object ID