mirror of
https://github.com/MarijnDoeve/TijdVoorDeTest.git
synced 2026-03-07 13:14:20 +01:00
Some tests
This commit is contained in:
@@ -43,15 +43,6 @@ class CandidateRepository extends ServiceEntityRepository
|
||||
->getOneOrNullResult();
|
||||
}
|
||||
|
||||
public function save(Candidate $candidate, bool $flush = true): void
|
||||
{
|
||||
$this->getEntityManager()->persist($candidate);
|
||||
|
||||
if ($flush) {
|
||||
$this->getEntityManager()->flush();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws DatetimeException
|
||||
*
|
||||
|
||||
@@ -17,13 +17,4 @@ class GivenAnswerRepository extends ServiceEntityRepository
|
||||
{
|
||||
parent::__construct($registry, GivenAnswer::class);
|
||||
}
|
||||
|
||||
public function save(GivenAnswer $givenAnswer, bool $flush = true): void
|
||||
{
|
||||
$this->getEntityManager()->persist($givenAnswer);
|
||||
|
||||
if ($flush) {
|
||||
$this->getEntityManager()->flush();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,17 @@ class SeasonRepository extends ServiceEntityRepository
|
||||
parent::__construct($registry, Season::class);
|
||||
}
|
||||
|
||||
public function findOneBySeasonCode(string $seasonCode): ?Season
|
||||
{
|
||||
return $this->getEntityManager()->createQuery(<<<DQL
|
||||
select s from Tvdt\Entity\Season s
|
||||
where s.seasonCode = :seasonCode
|
||||
DQL)
|
||||
->setParameter(':seasonCode', $seasonCode)
|
||||
->setMaxResults(1)
|
||||
->getOneOrNullResult();
|
||||
}
|
||||
|
||||
/** @return list<Season> Returns an array of Season objects */
|
||||
public function getSeasonsForUser(User $user): array
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user