🔖 Version 1.0.0-beta

This commit is contained in:
Marc Koch 2025-03-20 16:01:05 +01:00
parent c93a06972b
commit 460a811554
Signed by: marc.koch
GPG key ID: 12406554CFB028B9
26 changed files with 2480 additions and 771 deletions

View file

@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
namespace Civi\Mailinglistsync;
@ -37,7 +38,7 @@ function getLocationTypes(): array {
}
catch (\Exception $e) {
throw new MailinglistException(
E::ts('Could not get location types'),
"Could not get location types: {$e->getMessage()}",
MailinglistException::ERROR_CODE_GET_LOCATION_TYPES_FAILED,
);
}
@ -47,3 +48,13 @@ function getLocationTypes(): array {
return $locationTypes;
}
/**
* Get a user ID of the current session.
*
* @return int
*/
function getSessionUser(): int {
$session = \CRM_Core_Session::singleton();
return (int) $session->get('userID');
}