@@ -263,75 +263,6 @@ public function getPlaceWithDetails(TemplateHelper $plugin): string
263
263
return $ plugin ->getSubpart ('PLACE_LIST_COMPLETE ' );
264
264
}
265
265
266
- /**
267
- * Checks whether the current event has at least one place set, and if
268
- * this/these pace(s) have a country set.
269
- * Returns a boolean TRUE if at least one of the set places has a
270
- * country set, returns FALSE otherwise.
271
- *
272
- * IMPORTANT: This function does not check whether the saved ISO code is
273
- * valid at all. As this field is filled through the BE from a prefilled
274
- * list, this should never be an issue at all.
275
- *
276
- * @return bool whether at least one place with country are set for the current event
277
- */
278
- public function hasCountry (): bool
279
- {
280
- $ placesWithCountry = $ this ->getPlacesWithCountry ();
281
-
282
- return $ this ->hasPlace () && !empty ($ placesWithCountry );
283
- }
284
-
285
- /**
286
- * Returns an array of two-char ISO codes of countries for this event.
287
- * These are fetched from the referenced place records of this event. If no
288
- * place is set, or the set place(s) don't have any country set, an empty
289
- * array will be returned.
290
- *
291
- * @return list<string> the list of ISO codes for the countries of this event, may be empty
292
- */
293
- public function getPlacesWithCountry (): array
294
- {
295
- if (!$ this ->hasPlace ()) {
296
- return [];
297
- }
298
-
299
- $ countries = array_column ($ this ->getPlacesAsArray (), 'country ' );
300
- return array_filter (
301
- $ countries ,
302
- static fn (string $ country ): bool => $ country !== ''
303
- );
304
- }
305
-
306
- /**
307
- * Returns a comma-separated list of country names that were set in the
308
- * place record(s).
309
- * If no places are set, or no countries are selected in the set places,
310
- * an empty string will be returned.
311
- *
312
- * @return string comma-separated list of countries for this event, may be empty
313
- */
314
- public function getCountry (): string
315
- {
316
- if (!$ this ->hasCountry ()) {
317
- return '' ;
318
- }
319
-
320
- $ countryList = [];
321
-
322
- // Fetches the countries from the corresponding place records, may be
323
- // an empty array.
324
- // Get the real country names from the ISO codes.
325
- foreach ($ this ->getPlacesWithCountry () as $ currentCountry ) {
326
- $ countryList [] = $ this ->getCountryNameFromIsoCode ($ currentCountry );
327
- }
328
-
329
- // Makes sure that each country is exactly once in the array and then
330
- // returns this list.
331
- $ countryListUnique = array_unique ($ countryList );
332
- return implode (', ' , $ countryListUnique );
333
- }
334
-
335
266
/**
336
267
* Returns a comma-separated list of city names that were set in the place
337
268
* record(s).
@@ -381,25 +312,6 @@ public function getCitiesFromPlaces(): array
381
312
return \array_column ($ this ->getPlacesAsArray (), 'city ' );
382
313
}
383
314
384
- /**
385
- * Returns the name of the requested country from the static info tables.
386
- * If the country with this ISO code could not be found in the database,
387
- * an empty string is returned instead.
388
- *
389
- * @param string $isoCode the ISO 3166-1 alpha-2 code of the country, must not be empty
390
- *
391
- * @return string the short local name of the country or an empty
392
- * string if the country could not be found
393
- */
394
- public function getCountryNameFromIsoCode (string $ isoCode ): string
395
- {
396
- $ table = 'static_countries ' ;
397
- $ title = self ::getConnectionForTable ($ table )
398
- ->select (['cn_short_local ' ], $ table , ['cn_iso_2 ' => $ isoCode ])->fetchOne ();
399
-
400
- return \is_string ($ title ) ? $ title : '' ;
401
- }
402
-
403
315
/**
404
316
* Gets our place (or places) with address and links as HTML, not RTE'ed yet,
405
317
* separated by LF.
@@ -432,12 +344,6 @@ protected function getPlaceWithDetailsRaw(): string
432
344
$ place ['zip ' ] . ' ' . $ place ['city ' ]
433
345
);
434
346
}
435
- if ((string )($ place ['country ' ] ?? '' ) !== '' ) {
436
- $ countryName = $ this ->getCountryNameFromIsoCode ($ place ['country ' ]);
437
- if ($ countryName !== '' ) {
438
- $ descriptionParts [] = $ countryName ;
439
- }
440
- }
441
347
442
348
if (!empty ($ descriptionParts )) {
443
349
$ placeText .= ', ' . implode (', ' , $ descriptionParts );
@@ -457,7 +363,7 @@ protected function getPlaceWithDetailsRaw(): string
457
363
*
458
364
* The array will be two-dimensional: The first dimensional is just numeric.
459
365
* The second dimension is associative with the following keys:
460
- * title, address, city, country, homepage, directions
366
+ * title, address, city, homepage, directions
461
367
*
462
368
* @return list<array<string, string|int>>
463
369
* all places as a two-dimensional array, will be empty if there are no places assigned
@@ -467,7 +373,7 @@ protected function getPlacesAsArray(): array
467
373
$ queryBuilder = self ::getQueryBuilderForTable ('tx_seminars_sites ' );
468
374
469
375
return $ queryBuilder
470
- ->select ('uid ' , 'title ' , 'address ' , 'zip ' , 'city ' , 'country ' , ' homepage ' , 'directions ' )
376
+ ->select ('uid ' , 'title ' , 'address ' , 'zip ' , 'city ' , 'homepage ' , 'directions ' )
471
377
->from ('tx_seminars_sites ' )
472
378
->leftJoin (
473
379
'tx_seminars_sites ' ,
0 commit comments