<?php
namespace App\Entity\Repository;
use App\Entity\FaqCategory;
use Doctrine\ORM\EntityRepository;
/**
* @method FaqCategory|null find($id, $lockMode = null, $lockVersion = null)
* @method FaqCategory|null findOneBy(array $criteria, array $orderBy = null)
* @method FaqCategory[] findAll()
* @method FaqCategory[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
class FaqCategoryRepository extends EntityRepository
{
public function getByCategory(int $id): ?FaqCategory
{
return $this->createQueryBuilder('fc')
->andWhere('fc.id = :id')
->setParameter('id', $id)
->andWhere('fc.isPublished = 1')
->getQuery()->getOneOrNullResult();
}
}