asJson( $registrationManager->findCustomerRegistrationsWithEvent() ); } /** @noinspection PhpUnused */ /*** * @param $id_registration * @return Response * @throws Exception */ public function actionRegistration($id_registration) { $registrationManager = new EventRegistrationManager(); return $this->asJson( $registrationManager->findRegistration($id_registration) ); } /** * @noinspection PhpUnused * @param $id_event */ public function actionRegister($id_event) { /** @var Customer $customer */ $customer = Yii::$app->user->getIdentity(); $card =$customer->card; $form = new CardEventRegistrationForm(); $form->event_id = $id_event; $form->card_number = $card->number; $manager = new \common\manager\EventRegistrationManager(); $manager->registerCard($form); return $form->registration; } /** * Cancel a registration by id * @noinspection PhpUnused * @param $idRegistraton * @throws Throwable * @return Response */ public function actionCancel($idRegistraton) { $manager = new EventRegistrationManager(); $registration = $manager->loadRegistration($idRegistraton); $manager->deleteRegistration($registration); $registration = $manager->loadRegistration($idRegistraton); return $this->asJson($registration); } }