for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\Repository;
use App\Entity\Problem;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @method Problem|null find($id, $lockMode = null, $lockVersion = null)
* @method Problem|null findOneBy(array $criteria, array $orderBy = null)
* @method Problem[] findAll()
* @method Problem[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
class ProblemRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
parent::__construct($registry, Problem::class);
}
public function clearAllProblems(): void
$qb = $this->getEntityManager()->createQueryBuilder();
$qb->delete('App\Entity\Problem', 'p')->getQuery()->execute();
// /**
// * @return Problem[] Returns an array of Problem objects
// */
/*
public function findByExampleField($value)
return $this->createQueryBuilder('p')
->andWhere('p.exampleField = :val')
->setParameter('val', $value)
->orderBy('p.id', 'ASC')
->setMaxResults(10)
->getQuery()
->getResult()
;
public function findOneBySomeField($value): ?Problem
->getOneOrNullResult()