poc form SDK (symfony 6)

This commit is contained in:
Benjamin Dalsass
2023-10-06 10:17:38 +02:00
parent 025c5edd15
commit bead496968
22 changed files with 108 additions and 232 deletions

View File

@@ -13,17 +13,23 @@ class ClassParameterValueResolver implements ValueResolverInterface
{
if(\MetaModel::IsValidClass($argument->getType())){
// retrieve orm attribute
$aAttributes = $argument->getAttributesOfType(Orm::class);
$sParameterName = 'id';
// default mapping name
$sMapping = 'id';
// attribute defined mapping name
if(count($aAttributes) > 0){
$sParameterName = $aAttributes[0]->mapping;
$sMapping = $aAttributes[0]->mapping;
}
$sRef = $request->get($sParameterName);
// retrieve request parameter
$sRef = $request->get($sMapping);
// load orm object
$oObject = \MetaModel::GetObject($argument->getType(), $sRef);
return [$oObject];
}