key => []]; } /** * @inheritdoc */ public function getRegistrationAttributes(): array { return [$this->key => $this->name]; } /** * @inheritdoc */ public function getRegistrationMessages(): array { return []; } public function afterRegistration(Form $form, Participant $participant, array $input): void { foreach ($input[$this->key] as $memberData) { $member = Member::firstWhere(['mitgliedsnr' => $memberData['id']]); $data = []; foreach ($form->getFields() as $field) { $field = Field::fromConfig($field); $data[$field->key] = $field->namiType === null ? data_get($memberData, $field->key, $field->default()) : $field->namiType->getMemberAttribute($member); } $data[$this->key] = []; $form->participants()->create(['data' => $data]); } } }