public function getPublicRegistration($routeId, $expectedAreaStatus) { $this->transaction->requestTransaction(); try { $item = EdkRegistrationSettings::fetchPublic($this->conn, $routeId, $expectedAreaStatus); if (false === $item) { throw new ItemNotFoundException('There is no registration for this route available.'); } return $item; } catch (Exception $ex) { $this->transaction->requestRollback(); throw $ex; } }
/** * Fetches the participant by his/her access key. * * @param Connection $conn * @param string $key * @param int $expectedAreaStatus * @param boolean $forUpdate Whether to lock the registration settings for writing * @return EdkParticipant */ public static function fetchByKey(Connection $conn, $key, $expectedAreaStatus, $forUpdate = true) { $data = $conn->fetchAssoc('SELECT * FROM `' . EdkTables::PARTICIPANT_TBL . '` WHERE `accessKey` = :key', [':key' => $key]); if (false === $data) { return false; } $registrationSettings = EdkRegistrationSettings::fetchPublic($conn, $data['routeId'], $expectedAreaStatus, $forUpdate); if (empty($registrationSettings)) { return false; } $item = EdkParticipant::fromArray($data); $item->setRegistrationSettings($registrationSettings); return $item; }