ILIAS  release_8 Revision v8.24
class.ilObjectCustomIconFactory.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
23
25{
29
30 public function __construct(
34 ) {
35 $this->webDirectory = $webDirectory;
36 $this->uploadService = $uploadService;
37 $this->objectCache = $objectCache;
38 }
39
41 {
42 switch ($type) {
43 case 'grp':
44 case 'root':
45 case 'cat':
46 case 'fold':
47 case 'crs':
48 case 'prg':
49 $configuration = new ilContainerCustomIconConfiguration();
50 break;
51
52 default:
53 $configuration = new ilObjectCustomIconConfiguration();
54 break;
55 }
56
57 return $configuration;
58 }
59
60 public function getByObjId(int $objId, string $objType = ''): ilObjectCustomIcon
61 {
62 if ($objType === '') {
63 $objType = $this->objectCache->lookupType($objId);
64 }
65
66 return new ilObjectCustomIconImpl(
67 $this->webDirectory,
68 $this->uploadService,
69 $this->getConfigurationByType($objType),
70 $objId
71 );
72 }
73
74 public function getPresenterByObjId(int $objId, string $objType): ilObjectCustomIconPresenter
75 {
76 if ($objType === '') {
77 $objType = $this->objectCache->lookupType($objId);
78 }
79
80 switch ($objType) {
81 case 'catr':
82 case 'grpr':
83 case 'crsr':
84 $presenter = new ilObjectReferenceCustomIconPresenter($objId, $this);
85 $presenter->init();
86 break;
87
88 default:
89 $presenter = new ilObjectCustomIconPresenterImpl($this->getByObjId($objId, $objType));
90 break;
91
92 }
93
94 return $presenter;
95 }
96}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getPresenterByObjId(int $objId, string $objType)
getByObjId(int $objId, string $objType='')
__construct(Filesystem $webDirectory, FileUpload $uploadService, ilObjectDataCache $objectCache)
Class ilObjectCustomIconImpl TODO: Inject database persistence in future instead of using \ilContaine...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Interface Filesystem.
Definition: Filesystem.php:40
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class FlySystemFileAccessTest \Provider\FlySystem @runTestsInSeparateProcesses @preserveGlobalState d...
$type
$objId
Definition: xapitoken.php:57