| Code Coverage | ||||||||||
| Lines | Functions and Methods | Classes and Traits | ||||||||
| Total |  | 0.00% | 0 / 7 |  | 0.00% | 0 / 3 | CRAP |  | 0.00% | 0 / 1 | 
| TypeRepository |  | 0.00% | 0 / 7 |  | 0.00% | 0 / 3 | 30 |  | 0.00% | 0 / 1 | 
| __construct |  | 0.00% | 0 / 1 |  | 0.00% | 0 / 1 | 2 | |||
| add |  | 0.00% | 0 / 3 |  | 0.00% | 0 / 1 | 6 | |||
| remove |  | 0.00% | 0 / 3 |  | 0.00% | 0 / 1 | 6 | |||
| 1 | <?php | 
| 2 | |
| 3 | namespace App\Repository; | 
| 4 | |
| 5 | use App\Entity\Type; | 
| 6 | use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; | 
| 7 | use Doctrine\Persistence\ManagerRegistry; | 
| 8 | |
| 9 | /** | 
| 10 | * @extends ServiceEntityRepository<Type> | 
| 11 | * | 
| 12 | * @method Type|null find($id, $lockMode = null, $lockVersion = null) | 
| 13 | * @method Type|null findOneBy(array $criteria, array $orderBy = null) | 
| 14 | * @method Type[] findAll() | 
| 15 | * @method Type[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) | 
| 16 | */ | 
| 17 | class TypeRepository extends ServiceEntityRepository | 
| 18 | { | 
| 19 | public function __construct(ManagerRegistry $registry) | 
| 20 | { | 
| 21 | parent::__construct($registry, Type::class); | 
| 22 | } | 
| 23 | |
| 24 | public function add(Type $entity, bool $flush = false): void | 
| 25 | { | 
| 26 | $this->getEntityManager()->persist($entity); | 
| 27 | |
| 28 | if ($flush) { | 
| 29 | $this->getEntityManager()->flush(); | 
| 30 | } | 
| 31 | } | 
| 32 | |
| 33 | public function remove(Type $entity, bool $flush = false): void | 
| 34 | { | 
| 35 | $this->getEntityManager()->remove($entity); | 
| 36 | |
| 37 | if ($flush) { | 
| 38 | $this->getEntityManager()->flush(); | 
| 39 | } | 
| 40 | } | 
| 41 | |
| 42 | // /** | 
| 43 | // * @return Type[] Returns an array of Type objects | 
| 44 | // */ | 
| 45 | // public function findByExampleField($value): array | 
| 46 | // { | 
| 47 | // return $this->createQueryBuilder('t') | 
| 48 | // ->andWhere('t.exampleField = :val') | 
| 49 | // ->setParameter('val', $value) | 
| 50 | // ->orderBy('t.id', 'ASC') | 
| 51 | // ->setMaxResults(10) | 
| 52 | // ->getQuery() | 
| 53 | // ->getResult() | 
| 54 | // ; | 
| 55 | // } | 
| 56 | |
| 57 | // public function findOneBySomeField($value): ?Type | 
| 58 | // { | 
| 59 | // return $this->createQueryBuilder('t') | 
| 60 | // ->andWhere('t.exampleField = :val') | 
| 61 | // ->setParameter('val', $value) | 
| 62 | // ->getQuery() | 
| 63 | // ->getOneOrNullResult() | 
| 64 | // ; | 
| 65 | // } | 
| 66 | } |