ILIAS  release_7 Revision v7.30-3-g800a261c036
ObjectId.php
Go to the documentation of this file.
1<?php namespace ILIAS\Data;
2
3use ilObject2;
4
13{
14
18 private $object_id;
19
20
26 public function __construct(int $object_id)
27 {
28 $this->object_id = $object_id;
29 }
30
31
35 public function toInt() : int
36 {
37 return (int) $this->object_id;
38 }
39
40
44 public function toReferenceIds() : array
45 {
46 $ref_ids = [];
47 foreach (ilObject2::_getAllReferences($this->object_id) as $reference) {
48 $ref_ids[] = new ReferenceId((int) $reference);
49 }
50
51 return $ref_ids;
52 }
53}
An exception for terminatinating execution or to throw for unit testing.
__construct(int $object_id)
ReferenceId constructor.
Definition: ObjectId.php:26
Class ilObject2 This is an intermediate progress of ilObject class.
static _getAllReferences($a_id)
get all reference ids of object