* 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
46 lines
1.2 KiB
PHP
46 lines
1.2 KiB
PHP
<?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()
|
|
// ;
|
|
// }
|
|
}
|