46
46
use models \exceptions \ValidationException ;
47
47
use models \main \ICompanyRepository ;
48
48
use models \main \IMemberRepository ;
49
+ use models \main \ITagRepository ;
49
50
use models \main \Member ;
50
51
use models \oauth2 \IResourceServerContext ;
51
52
use models \summit \factories \SummitAttendeeFactory ;
@@ -1088,6 +1089,11 @@ final class SummitOrderService
1088
1089
*/
1089
1090
private $ ticket_finder_strategy_factory ;
1090
1091
1092
+ /**
1093
+ * @var ITagRepository
1094
+ */
1095
+ private $ tags_repository ;
1096
+
1091
1097
/**
1092
1098
* @param ISummitTicketTypeRepository $ticket_type_repository
1093
1099
* @param IMemberRepository $member_repository
@@ -1103,6 +1109,7 @@ final class SummitOrderService
1103
1109
* @param IFileUploadStrategy $upload_strategy
1104
1110
* @param IFileDownloadStrategy $download_strategy
1105
1111
* @param ICompanyRepository $company_repository
1112
+ * @param ITagRepository $tags_repository
1106
1113
* @param ICompanyService $company_service
1107
1114
* @param ITicketFinderStrategyFactory $ticket_finder_strategy_factory
1108
1115
* @param ITransactionService $tx_service
@@ -1124,6 +1131,7 @@ public function __construct
1124
1131
IFileUploadStrategy $ upload_strategy ,
1125
1132
IFileDownloadStrategy $ download_strategy ,
1126
1133
ICompanyRepository $ company_repository ,
1134
+ ITagRepository $ tags_repository ,
1127
1135
ICompanyService $ company_service ,
1128
1136
ITicketFinderStrategyFactory $ ticket_finder_strategy_factory ,
1129
1137
ITransactionService $ tx_service ,
@@ -1148,6 +1156,7 @@ public function __construct
1148
1156
$ this ->company_repository = $ company_repository ;
1149
1157
$ this ->company_service = $ company_service ;
1150
1158
$ this ->ticket_finder_strategy_factory = $ ticket_finder_strategy_factory ;
1159
+ $ this ->tags_repository = $ tags_repository ;
1151
1160
}
1152
1161
1153
1162
/**
@@ -3473,6 +3482,7 @@ public function importTicketData(Summit $summit, UploadedFile $csv_file): void
3473
3482
* attendee_email ( mandatory if id and number are missing)
3474
3483
* attendee_first_name (mandatory)
3475
3484
* attendee_last_name (mandatory)
3485
+ * attendee_tags (optional)
3476
3486
* attendee_company (optional)
3477
3487
* attendee_company_id (optional)
3478
3488
* ticket_type_name ( mandatory if id and number are missing)
@@ -3605,8 +3615,18 @@ public function processTicketData(int $summit_id, string $filename)
3605
3615
3606
3616
Log::debug (sprintf ("SummitOrderService::processTicketData creating attendee with payload %s " , json_encode ($ payload )));
3607
3617
3618
+
3608
3619
$ attendee = SummitAttendeeFactory::build ($ summit , $ payload , $ member );
3609
3620
3621
+ if ($ reader ->hasColumn ('attendee_tags ' )) {
3622
+ $ tags = explode ('| ' , $ row ['attendee_tags ' ]);
3623
+ $ attendee ->clearTags ();
3624
+ foreach ($ tags as $ tag_val ) {
3625
+ $ tag = $ this ->tags_repository ->getByTag ($ tag_val );
3626
+ if (is_null ($ tag )) continue ;
3627
+ $ attendee ->addTag ($ tag );
3628
+ }
3629
+ }
3610
3630
$ this ->attendee_repository ->add ($ attendee );
3611
3631
}
3612
3632
}
0 commit comments