/**
  *
  * @param WebHook $webHook The WebHook entity
  *
  * @return Form The form
  */
 private function createClearNotificationsForm(WebHook $webHook = null)
 {
     if ($webHook) {
         $data = ['id' => $webHook->getId()];
     } else {
         $data = null;
     }
     return $this->createFormBuilder($data)->setAction($this->generateUrl('webhook_clear_notification'))->add('id', HiddenType::class)->setMethod('DELETE')->getForm();
 }
Beispiel #2
0
 private function getAttachedSocketClients(WebHook $webHook)
 {
     $socketClients = [];
     $clientEntities = $webHook->getClients();
     foreach ($clientEntities as $clientEntity) {
         $clientId = array_search($clientEntity, $this->clientEntities);
         $socketClient = null;
         foreach ($this->socketClients as $clientItem) {
             if ($clientItem->resourceId == $clientId) {
                 $socketClient = $clientItem;
                 break;
             }
         }
         $socketClients[] = $socketClient;
     }
     return $socketClients;
 }
 public function executeRemoveWebHook(WebHook $webHook, callable $onSuccess, callable $onError)
 {
     $this->defaultExecute('removeWebHook', ['endpoint' => $webHook->getEndpoint(), 'secret' => $webHook->getUser()->getSecret()], $onSuccess, $onError);
 }