N°8772 - Form dependencies manager implementation

- Form SDK implementation
- Basic Forms
- Dynamics Forms
- Basic Blocks + Data Model Block
- Form Compilation
- Turbo integration
This commit is contained in:
Benjamin Dalsass
2025-12-30 11:42:55 +01:00
committed by GitHub
parent 3955b4eb22
commit 4c1ad0f4f2
813 changed files with 115243 additions and 489 deletions

View File

@@ -0,0 +1,44 @@
<?php
/*
* @copyright Copyright (C) 2010-2025 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
namespace Combodo\iTop\Forms\IO\Converter;
use Combodo\iTop\Service\DependencyInjection\DIException;
use Combodo\iTop\Service\DependencyInjection\DIService;
use Combodo\iTop\Forms\IO\Format\ClassIOFormat;
use Combodo\iTop\Forms\IO\FormBlockIOException;
use Exception;
use ModelReflection;
/**
* Extract the selected class from an OQL query.
*
* @package Combodo\iTop\Forms\IO\Converter
* @since 3.3.0
*/
class OqlToClassConverter extends AbstractConverter
{
/** @inheritdoc
* @throws DIException
* @throws FormBlockIOException
*/
public function Convert(mixed $oData): ?ClassIOFormat
{
if ($oData === null) {
return null;
}
/** @var ModelReflection $oModelReflection */
$oModelReflection = DIService::GetInstance()->GetService('ModelReflection');
try {
$oQuery = $oModelReflection->GetQuery($oData);
} catch (Exception $e) {
throw new FormBlockIOException($e->getMessage(), $e->getCode(), $e);
}
return new ClassIOFormat($oQuery->GetClass());
}
}