src/BCRM/BackendBundle/Entity/Event/DoctrineEventRepository.php 1 location
|
@@ 20-29 (lines=10) @@
|
| 17 |
|
/** |
| 18 |
|
* @return Option |
| 19 |
|
*/ |
| 20 |
|
public function getNextEvent() |
| 21 |
|
{ |
| 22 |
|
$qb = $this->createQueryBuilder('e'); |
| 23 |
|
$qb->andWhere('e.registrationStart <= :now'); |
| 24 |
|
$qb->setParameter('now', new \DateTime()); |
| 25 |
|
$qb->setMaxResults(1); |
| 26 |
|
$qb->orderBy('e.start', 'ASC'); |
| 27 |
|
$event = $qb->getQuery()->getOneOrNullResult(); |
| 28 |
|
return $event == null ? None::create() : new Some($event); |
| 29 |
|
} |
| 30 |
|
|
| 31 |
|
/** |
| 32 |
|
* @param Event $event |
src/BCRM/BackendBundle/Entity/Event/DoctrineUnregistrationRepository.php 1 location
|
@@ 55-62 (lines=8) @@
|
| 52 |
|
* |
| 53 |
|
* @return \PhpOption\Option |
| 54 |
|
*/ |
| 55 |
|
public function getUnregistrationByIdAndKey($id, $key) |
| 56 |
|
{ |
| 57 |
|
$qb = $this->createQueryBuilder('u'); |
| 58 |
|
$qb->andWhere('u.id = :id')->setParameter('id', $id); |
| 59 |
|
$qb->andWhere('u.confirmationKey = :key')->setParameter('key', $key); |
| 60 |
|
$result = $qb->getQuery()->getOneOrNullResult(); |
| 61 |
|
return $result === null ? None::create() : new Some($result); |
| 62 |
|
} |
| 63 |
|
|
| 64 |
|
/** |
| 65 |
|
* @param Event $event |