Пример #1
0
 /**
  * CsvHelper constructor.
  * @param Submission[] $submissions
  * @param  Form        $form
  * @param  ArrObject   $options
  */
 public function __construct($submissions, $form, ArrObject $options)
 {
     $this->submissions = $submissions;
     $this->form = $form;
     $this->form->fields = $form->getFields();
     $this->options = $options;
 }
Пример #2
0
 public function getFieldsubmissions()
 {
     if (!isset($this->fieldsubmissions)) {
         $fields = $this->form->getFields();
         foreach ($this->data as $submissionvalue) {
             if (isset($fields[$submissionvalue['field_id']])) {
                 $field = $fields[$submissionvalue['field_id']];
             } else {
                 //field might be deleted from form
                 $field = Field::create();
                 $field->setType($submissionvalue['type']);
             }
             $this->fieldsubmissions[$field->slug] = (new Fieldsubmission($field, $submissionvalue))->toFormattedArray();
         }
     }
     return $this->fieldsubmissions;
 }