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,7 +8,7 @@
namespace Combodo\iTop\Forms\Validator;
use Combodo\iTop\Forms\IO\Converter\OqlToClassConverter;
use Combodo\iTop\Service\DependencyInjection\ServiceLocator;
use Combodo\iTop\Service\ServiceLocator\ServiceLocator;
use Symfony\Component\PropertyAccess\PropertyAccess;
use Symfony\Component\PropertyAccess\PropertyAccessorInterface;
use Symfony\Component\Validator\Constraint;
@@ -41,8 +41,8 @@ class AttributeExistValidator extends ConstraintValidator
$sClass = "UserRequest";
/** List attributes @var ModelReflection $oModelReflection */
$oModelReflection = ServiceLocator::GetInstance()->get('ModelReflection');
/** @var \ModelReflection $oModelReflection */
$oModelReflection = \MetaModel::GetService('ModelReflection');
$aAttributeCodes = array_keys($oModelReflection->ListAttributes($sClass));
if (!in_array($value, $aAttributeCodes, true)) {