* initial api stuff

This commit is contained in:
Danyi Dávid
2018-05-11 10:46:00 +02:00
parent 77325b8e94
commit be7bc7279d
48 changed files with 3793 additions and 325 deletions

View File

@@ -17,6 +17,13 @@ class AwardeeManager
$this->entityManager = $entityManager;
}
public function getAwardees(): ?array
{
return $this->entityManager->getRepository(Awardee::class)->findBy([], [
'year' => 'DESC',
]);
}
/**
* @param int $year
* @return Awardee[]
@@ -28,6 +35,13 @@ class AwardeeManager
]);
}
public function getAwardee(int $id): ?Awardee
{
/** @var Awardee $awardee */
$awardee = $this->entityManager->getRepository(Awardee::class)->find($id);
return $awardee;
}
/**
* @param string $slug
* @return Awardee|null