mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 18:48:51 +02:00
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:
43
sources/Controller/Base/Layout/OqlController.php
Normal file
43
sources/Controller/Base/Layout/OqlController.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* @copyright Copyright (C) 2010-2024 Combodo SAS
|
||||
* @license http://opensource.org/licenses/AGPL-3.0
|
||||
*/
|
||||
|
||||
namespace Combodo\iTop\Controller\Base\Layout;
|
||||
|
||||
use Combodo\iTop\Controller\AbstractController;
|
||||
use Exception;
|
||||
use Combodo\iTop\Application\WebPage\JsonPage;
|
||||
use ModelReflection;
|
||||
use ModelReflectionRuntime;
|
||||
|
||||
class OqlController extends AbstractController
|
||||
{
|
||||
public const ROUTE_NAMESPACE = 'oql';
|
||||
|
||||
public function OperationValidateQuery()
|
||||
{
|
||||
$oPage = new JsonPage();
|
||||
$oPage->SetOutputDataOnly(true);
|
||||
|
||||
$data = json_decode(file_get_contents('php://input'), true);
|
||||
$sOql = $data['query'];
|
||||
|
||||
try {
|
||||
/** @var ModelReflection $oModelReflection */
|
||||
$oModelReflexion = new ModelReflectionRuntime();
|
||||
$oModelReflexion->GetQuery($sOql);
|
||||
} catch (Exception $e) {
|
||||
|
||||
}
|
||||
|
||||
$oPage->SetData([
|
||||
'is_valid' => !isset($e),
|
||||
]);
|
||||
|
||||
$oPage->output();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user