-
Notifications
You must be signed in to change notification settings - Fork 1
NotificationService
github-actions[bot] edited this page Jun 27, 2023
·
12 revisions
Handles incoming notification api-calls by finding or creating a synchronization and synchronizing an object.
| Name | Description |
|---|---|
| __construct | The constructor sets al needed variables. |
| findSource | Tries to find a source using the url of the object a notification was created for. |
| notificationHandler | Handles incoming notification api-call and is responsible for generating a response. |
Description
public __construct (\EntityManagerInterface $entityManager, \LoggerInterface $notificationLogger, \SynchronizationService $syncService, \GatewayResourceService $resourceService)The constructor sets al needed variables.
Parameters
-
(\EntityManagerInterface) $entityManager: The EntityManager. -
(\LoggerInterface) $notificationLogger: The notification logger. -
(\SynchronizationService) $syncService: The SynchronizationService. -
(\GatewayResourceService) $resourceService: The GatewayResourceService.
Return Values
void
Description
public findSource (string $url)Tries to find a source using the url of the object a notification was created for.
Parameters
-
(string) $url: The url we are trying to find a matching Source for.
Return Values
\Source
The Source we found.
Throws Exceptions
\Exception
If we did not find one Source we throw an exception.
Description
public notificationHandler (array $data, array $configuration)Handles incoming notification api-call and is responsible for generating a response.
Parameters
-
(array) $data: The data from the call -
(array) $configuration: The configuration from the call
Return Values
array
A handler must ALWAYS return an array