ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 }
init()
Init If the target is invalid the icon instance creation is based on the reference object obj_id...
lookupTargetId()
Lookup target id of container reference.
Class ilObjectCustomIconFactory.
__construct(int $obj_id, \ilObjectCustomIconFactory $factory)
ilObjectReferenceCustomIconPresenter constructor.
static _lookupTargetId($a_obj_id)
lookup target id