Enhance Service locator

This commit is contained in:
Eric Espie
2026-01-27 11:54:05 +01:00
parent 390b5c0bc3
commit bfa7a209d6
43 changed files with 338 additions and 210 deletions

View File

@@ -8,6 +8,7 @@
namespace Combodo\iTop\Application\Dashlet;
use Combodo\iTop\Application\Dashlet\Service\DashletService;
use MetaModel;
use ModelReflectionRuntime;
class DashletFactory
@@ -36,7 +37,9 @@ class DashletFactory
public function CreateDashlet(string $sClass, string $sId): Dashlet
{
if (!DashletService::GetInstance()->IsDashletAvailable($sClass)) {
/** @var DashletService $oDashletService */
$oDashletService = MetaModel::GetService('DashletService');
if (!$oDashletService->IsDashletAvailable($sClass)) {
$sClass = 'DashletUnknown';
//throw new DashletException("Dashlet ".json_encode($sClass)." is not available");
}