optimize ui

add new ki endpoint params
This commit is contained in:
team2
2026-02-17 20:36:47 +01:00
parent 5b2a633a99
commit 6822c8f3f8
23 changed files with 1915 additions and 608 deletions

View File

@@ -0,0 +1,41 @@
<?php
declare(strict_types=1);
namespace App\Repository;
use App\Entity\ModelGenerationConfig;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
final class ModelGenerationConfigRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, ModelGenerationConfig::class);
}
public function findActiveForModel(string $modelName): ?ModelGenerationConfig
{
return $this->createQueryBuilder('c')
->andWhere('c.modelName = :model')
->andWhere('c.active = true')
->setParameter('model', $modelName)
->orderBy('c.version', 'DESC')
->setMaxResults(1)
->getQuery()
->getOneOrNullResult();
}
public function findNextVersion(string $modelName): int
{
$qb = $this->createQueryBuilder('c')
->select('MAX(c.version)')
->andWhere('c.modelName = :model')
->setParameter('model', $modelName);
$max = $qb->getQuery()->getSingleScalarResult();
return $max ? ((int)$max + 1) : 1;
}
}