original_string: public function data_postprocessing($data) {
          parent::data_postprocessing($data);
  
          foreach (['text', 'file'] as $type) {
              $field = 'submissiontype' . $type;
              $available = $field . 'available';
              $required = $field . 'required';
              if ($data->$required) {
                  $data->$field = WORKSHOP_SUBMISSION_TYPE_REQUIRED;
              } else if ($data->$available) {
                  $data->$field = WORKSHOP_SUBMISSION_TYPE_AVAILABLE;
              } else {
                  $data->$field = WORKSHOP_SUBMISSION_TYPE_DISABLED;
              }
              unset($data->$available);
              unset($data->$required);
          }
      }
code: public function data_postprocessing($data) {
          parent::data_postprocessing($data);
  
          foreach (['text', 'file'] as $type) {
              $field = 'submissiontype' . $type;
              $available = $field . 'available';
              $required = $field . 'required';
              if ($data->$required) {
                  $data->$field = WORKSHOP_SUBMISSION_TYPE_REQUIRED;
              } else if ($data->$available) {
                  $data->$field = WORKSHOP_SUBMISSION_TYPE_AVAILABLE;
              } else {
                  $data->$field = WORKSHOP_SUBMISSION_TYPE_DISABLED;
              }
              unset($data->$available);
              unset($data->$required);
          }
      }
code_tokens: public function data_postprocessing ( $ data ) { parent :: data_postprocessing ( $ data ) ; foreach ( [ 'text' , 'file' ] as $ type ) { $ field = 'submissiontype' . $ type ; $ available = $ field . 'available' ; $ required = $ field . 'required' ; if ( $ data -> $ required ) { $ data -> $ field = WORKSHOP_SUBMISSION_TYPE_REQUIRED ; } else if ( $ data -> $ available ) { $ data -> $ field = WORKSHOP_SUBMISSION_TYPE_AVAILABLE ; } else { $ data -> $ field = WORKSHOP_SUBMISSION_TYPE_DISABLED ; } unset ( $ data -> $ available ) ; unset ( $ data -> $ required ) ; } }
docstring: Combine submission type checkboxes into integer values for the database.
  
  @param stdClass $data The submitted form data.
docstring_tokens: Combine submission type checkboxes into integer values for the database .