N°8771 - Add Symfony form component to iTop core

- IO
This commit is contained in:
Benjamin Dalsass
2025-10-24 07:54:51 +02:00
parent a51272f107
commit 7708f8e00e
11 changed files with 133 additions and 22 deletions

View File

@@ -0,0 +1,25 @@
<?php
/*
* @copyright Copyright (C) 2010-2025 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
namespace Combodo\iTop\Forms\Converter;
use Combodo\iTop\Forms\Block\IO\Format\ClassIOFormat;
/**
* OQL expression to class converter.
*/
class OqlToClassConverter extends AbstractOutputConverter
{
/** @inheritdoc */
public function Convert(mixed $oData): ?ClassIOFormat
{
if($oData === null)
return null;
// extract selected class
preg_match('/SELECT\s+(\w+)/', $oData, $aMatches);
return new ClassIOFormat($aMatches[1]) ?? null;
}
}