feat: Themes (#257)

* feat: add trait to unify get by id or slug logic

* feat: add Theme resource

* fix: categories and themes

* feat: update api docs for projects to themes relationship

* feat: update doctrine relationship of projects to themes

* feat: add v3 categories to v4 themes pumping during projects pumping
This commit is contained in:
2026-10-08 13:02:07 +02:00
committed by GitHub
parent 14ee28be4f
commit ac47aec378
20 changed files with 562 additions and 50 deletions
+45
View File
@@ -0,0 +1,45 @@
<?php
namespace App\Repository;
use App\Entity\Theme;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<Theme>
*/
class ThemeRepository extends ServiceEntityRepository
{
use FindByIdOrSlugTrait;
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, Theme::class);
}
// /**
// * @return Theme[] Returns an array of Theme objects
// */
// public function findByExampleField($value): array
// {
// return $this->createQueryBuilder('t')
// ->andWhere('t.exampleField = :val')
// ->setParameter('val', $value)
// ->orderBy('t.id', 'ASC')
// ->setMaxResults(10)
// ->getQuery()
// ->getResult()
// ;
// }
// public function findOneBySomeField($value): ?Theme
// {
// return $this->createQueryBuilder('t')
// ->andWhere('t.exampleField = :val')
// ->setParameter('val', $value)
// ->getQuery()
// ->getOneOrNullResult()
// ;
// }
}