ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ObjectId.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 namespace ILIAS\Data;
6 
7 use ilObject2;
8 
16 class ObjectId
17 {
18  private int $object_id;
19 
23  public function __construct(int $object_id)
24  {
25  $this->object_id = $object_id;
26  }
27 
28  public function toInt(): int
29  {
30  return $this->object_id;
31  }
32 
36  public function toReferenceIds(): array
37  {
38  $ref_ids = [];
39  foreach (ilObject2::_getAllReferences($this->object_id) as $reference) {
40  $ref_ids[] = new ReferenceId((int) $reference);
41  }
42 
43  return $ref_ids;
44  }
45 }
__construct(int $object_id)
ReferenceId constructor.
Definition: ObjectId.php:23
static _getAllReferences(int $id)
get all reference ids for object ID