ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilObjectReferenceCustomIconPresenter.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2018 ILIAS open source, Extended GPL, see docs/LICENSE */
3
8{
10 private $factory = null;
11
13 private $icon = null;
14
16 private $obj_id = 0;
17
24 {
25 $this->factory = $factory;
26 $this->obj_id = $obj_id;
27 }
28
34 public function init()
35 {
36 $target_obj_id = $this->lookupTargetId();
37 $this->icon = $this->factory->getByObjId($target_obj_id);
38 }
39
40
41
45 public function exists() : bool
46 {
47 return $this->icon->exists();
48 }
49
53 public function getFullPath() : string
54 {
55 return $this->icon->getFullPath();
56 }
57
62 protected function lookupTargetId() : int
63 {
64 $target_obj_id = ilContainerReference::_lookupTargetId($this->obj_id);
65 return $target_obj_id;
66 }
67}
An exception for terminatinating execution or to throw for unit testing.
static _lookupTargetId($a_obj_id)
lookup target id
Class ilObjectCustomIconFactory.
init()
Init \ilObjectCustomIconPresenter If the target is invalid the icon instance creation is based on the...
lookupTargetId()
Lookup target id of container reference.
__construct(int $obj_id, \ilObjectCustomIconFactory $factory)
ilObjectReferenceCustomIconPresenter constructor.