ILIAS  release_8 Revision v8.24
ObjectId.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
5namespace ILIAS\Data;
6
7use ilObject2;
8
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
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