public function isCustomQuestionRequired()
 {
     if (null !== $this->registrationSettings) {
         $value = $this->registrationSettings->getCustomQuestion();
         return !empty($value);
     }
     return false;
 }
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     $builder->add('registrationType', ChoiceType::class, ['label' => 'Registration type', 'choices' => EdkRegistrationSettings::getRegistrationTypes()])->add('startTime', DateTimeType::class, array('label' => 'Beginning of registration', 'years' => $this->currentYears(), 'input' => 'timestamp', 'model_timezone' => 'UTC', 'view_timezone' => $this->timezone->getName(), 'required' => false))->add('endTime', DateTimeType::class, array('label' => 'End of registration', 'years' => $this->currentYears(), 'input' => 'timestamp', 'model_timezone' => 'UTC', 'view_timezone' => $this->timezone->getName(), 'required' => false))->add('externalRegistrationUrl', UrlType::class, ['label' => 'External registration URL', 'attr' => ['help_text' => 'ExternalRegistrationUrlHint'], 'required' => false])->add('externalParticipantNum', NumberType::class, ['label' => 'Number of participants registered externally', 'attr' => ['help_text' => 'ExternalParticipantNumHint'], 'required' => false])->add('participantLimit', NumberType::class, array('label' => 'Expected number of participants', 'required' => false))->add('allowLimitExceed', BooleanType::class, array('label' => 'Allow exceeding the participant limit', 'attr' => array('help_text' => 'AllowLimitExceedHint'), 'required' => false))->add('maxPeoplePerRecord', NumberType::class, array('label' => 'Max. number of people in the record', 'attr' => array('help_text' => 'MaxPeoplePerRecordHint'), 'required' => false))->add('customQuestion', TextType::class, array('label' => 'Custom question', 'attr' => array('help_text' => 'CustomQuestionHint'), 'required' => false))->add('save', SubmitType::class, array('label' => 'Save'));
 }
 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;
     }
 }
 /**
  * @return EdkRegistrationSettings
  */
 public function getItem($id)
 {
     $this->transaction->requestTransaction();
     try {
         $route = EdkRoute::fetchByRoot($this->conn, $id, $this->root);
         if (empty($route)) {
             throw new ItemNotFoundException('The specified route has not been found.');
         }
         return EdkRegistrationSettings::fetchByRoute($this->conn, $route);
     } catch (Exception $ex) {
         $this->transaction->requestRollback();
         throw $ex;
     }
 }
Example #5
0
 public function remove(Connection $conn)
 {
     $conn->delete(EdkTables::PARTICIPANT_TBL, ['id' => $this->id]);
     $this->registrationSettings->unregisterParticipant($conn, $this);
 }