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

@@ -13,6 +13,7 @@ use Combodo\iTop\Forms\Block\FormBlockService;
use Combodo\iTop\PropertyType\Compiler\PropertyTypeCompiler;
use Combodo\iTop\PropertyType\Compiler\PropertyTypeCompilerException;
use Combodo\iTop\Service\Cache\DataModelDependantCache;
use MetaModel;
use utils;
class PropertyTypeService
@@ -21,20 +22,9 @@ class PropertyTypeService
private DataModelDependantCache $oCacheService;
private static PropertyTypeService $oInstance;
protected function __construct()
public function __construct()
{
$this->oCacheService = DataModelDependantCache::GetInstance();
}
final public static function GetInstance(): PropertyTypeService
{
if (!isset(static::$oInstance)) {
static::$oInstance = new PropertyTypeService();
}
return static::$oInstance;
$this->oCacheService = MetaModel::GetService('DataModelDependantCache');
}
/**