{@inheritDoc}

@param Notify $request
176939
public function execute($request)
    {
        RequestNotSupportedException::assertSupports($this, $request);
        $this->logger->info("Ecommpay order #{$request->getFirstModel()->getOrder()->getNumber()} have paid");
        throw new HttpResponse('OK');
    }
1024726
public function show($id, ShowRequest $request)
    {
        $user = $request->user();
        $item = $user->notifications()->find($id);
        if (empty($item)) {
            return $this->sendError('Notification not found');
        }
        $item->load($request->getWith());

        return $this->sendResponse($item, '');
    }
1372883
public function forgot(Request $request)
  {
    $request->rules = ['email' => 'required|string|email'];

    $request->validate();
    $provider = $this->provider;

    $info = $this->notify($request, $provider, $this->musk());

    $this->sendPasswordResetNotification($info['email'], $info['token']);
    $this->redirectUser();
  }
240093
private function onRequestBeforeSend(RequestInterface $request)
    {
        $hash = $this->hash($request);
        $this->stopwatch->start($hash, self::NAME);
    }
1355344
public void notifyObserversOfRequestProcessed(CachedSpiceRequest<?> request, Set<RequestListener<?>> requestListeners) {
        RequestProcessingContext requestProcessingContext = new RequestProcessingContext();
        requestProcessingContext.setExecutionThread(Thread.currentThread());
        requestProcessingContext.setRequestListeners(requestListeners);
        post(new RequestProcessedNotifier(request, spiceServiceListenerList, requestProcessingContext));
    }
287343
public function sendRequest(RequestInterface $request): void
    {
        $requestId = $this->getRequestId($request);
        $this->pendingRequests[$requestId] = $this->createPromiseForRequest($request, true);
    }
1178725
public function send($notifiable, Notification $notification)
    {
        if (! $url = $notifiable->routeNotificationFor('Webhook')) {
            return;
        }

        $webhookData = $notification->toWebhook($notifiable)->toArray();

        $response = $this->client->post($url, [
            'body' => json_encode(Arr::get($webhookData, 'data')),
            'verify' => false,
            'headers' => Arr::get($webhookData, 'headers'),
        ]);

        if ($response->getStatusCode() >= 300 || $response->getStatusCode() < 200) {
            throw CouldNotSendNotification::serviceRespondedWithAnError($response);
        }
    }
226744
public function send(Request $request)
    {
        $afterValidate = $request->get('afterValidate');
        $notifications = (array) $request->get('notifications', []);

        if (! $afterValidate) {
            return $this->form->get()->isValid();
        }

        $this->fire($this->findModel($notifications));

        return new JsonResponse(['message' => trans('antares/notifications::messages.widget_notification_added_to_queue')]);
    }
998848
public function setRequestOnHandler($request)
    {
        if ($this->handlerNeedsRequest()) {
            /** @var NeedRequestInterface $handler */
            $handler = $this->getHandler();
            $handler->setRequest($request);
        }
    }
661412
public function newAction(Request $request)
    {
        
        $em = $this->getDoctrine()->getManager();
        $formConfig = array();
        $user = $this->container->get('security.token_storage')->getToken()->getUser();  
        if ($user->isGranted('ROLE_USER')) { 
            $formConfig['actor'] = $user; 
            //disable notification
            $admin = $em->getRepository('CoreBundle:Actor')->find(1);//admin
            $notificationManager = $this->container->get('notification_manager');
            $notificationManager->disableNotificationByDetail(
                    $admin, //admin
                    $user,//current user
                    'add_product', 
                    '"actor":'.$user->getId().'}'
                );
        }
        $entity = new Product();
        $form = $this->createForm('EcommerceBundle\Form\ProductType', $entity, $formConfig);
        $form->handleRequest($request);

        if ($form->isSubmitted() && $form->isValid()) {
            $em->persist($entity);
            $em->flush();
            
            if($entity->getActor() instanceof Actor){
                //send emails to admin and actor
                $this->get('core.mailer')->sendActorNewProduct($entity);
            }
            $this->get('session')->getFlashBag()->add('success', 'product.created');

            return $this->redirectToRoute('ecommerce_product_show', array('id' => $entity->getId()));
        }

        return array(
            'entity' => $entity,
            'form' => $form->createView(),
        );
    }
155670
public function block( $model, $notify = true, $config = [] ) {

		if( !$model->isBlocked( true ) ) {

			$model = $this->updateStatus( $model, IApproval::STATUS_BLOCKED );

			if( $notify ) {

				$title = ucfirst( self::$parentType ) . ' - ' . $model->getClassName() . ' - Blocked';

				$config[ 'template' ] = CoreGlobal::TPL_NOTIFY_STATUS_BLOCK;
				$config[ 'data' ][ 'message' ] = $model->getRejectMessage();

				$this->notifyUser( $model, $config, $title );
			}

			return $model;
		}

		return false;
	}
91659
public function watching(string $folder, string $keys, Chan $notify) : void
    {
        $path = $keys === '*' ? $folder : sprintf('%s/%s', $folder, $keys);

        $ig = function () use ($path) {
            return (new KVGetting($this->agent))->path($path);
        };

        $do = function (KVGetting $lister) use ($notify) {
            yield $notify->send($this->changed(yield $lister->result()));
        };

        $this->nwProcess($notify->closed(), $ig, $do, 'KVStore watcher interrupted', ['path' => $path]);
    }
1361580
public function update(NotificationUpdateRequest $request, $id)
    {
        $result = $this->service->update($id, $request->except('_token'));

        if ($result) {
            return back()->with('message', 'Successfully updated');
        }

        return back()->with('errors', ['Failed to update']);
    }
1308837
public function execute($request)
    {
        RequestNotSupportedException::assertSupports($this, $request);

        $model = ArrayObject::ensureArrayObject($request->getModel());

        // invalidate:
        // - we process only replied and notified payments
        if (!isset($model['state']) ||
            !in_array(
                $model['state'],
                array(
                    StateInterface::STATE_REPLIED,
                    StateInterface::STATE_NOTIFIED,
                    StateInterface::STATE_CONFIRMED,
                )
            )
        ) {
            // return;
        }

        $httpRequest = new GetHttpRequest;
        $this->gateway->execute($httpRequest);

        if ($httpRequest->method != 'POST') {
            return;
        }

        $status = Api::STATUS_OK;
        $model['state'] = StateInterface::STATE_NOTIFIED;
        $notification = $httpRequest->request;
        $redirectUrl = $model['afterUrl'];
        // check signature hash
        
        if ($this->api->tamperingDetected((array) $notification, (array) $model->toUnsafeArray())) {
            $status = Api::STATUS_INVALID;
            $statusDetails = "Tampering detected. Wrong hash.";
        } else {
            if ($notification['Status'] == Api::STATUS_OK) {
                $model['state'] = StateInterface::STATE_CONFIRMED;
            } elseif ($notification['Status'] == Api::STATUS_PENDING) {
                $model['state'] = StateInterface::STATE_REPLIED;
            } else {
                $model['state'] = StateInterface::STATE_ERROR;
            }

            $statusDetails = 'Transaction processed';

            if ($notification['Status'] == Api::STATUS_ERROR
                && isset($notification['Vendor'])
                && isset($notification['VendorTxCode'])
                && isset($notification['StatusDetail'])
            ) {
                $status = Api::STATUS_ERROR;
                $statusDetails = 'Status of ERROR is seen, together with your Vendor, VendorTxCode and the StatusDetail.';
            }

        }

        $model['notification'] = (array) $notification;
        $model->replace(
            $model->toUnsafeArray()
        );

        $params = array(
            'Status' => $status,
            'StatusDetails' => $statusDetails,
            'RedirectURL' => $redirectUrl,
            );

        throw new NotifyResponse($params);
    }
507191
public function saveOrUpdate(Announcement $announcement, Request $request)
    {
        $announcement
            ->fill($request->get('announcement'))
            ->fill([
                'user_id' => $request->user()->id,
                'active'  => 1,
            ])->save();

        Alert::info(__('Announcement has been created or updated.'));

        return back();
    }
204695
public function index(Request $request)
    {
        $notifications = $this->service->paginated();
        return view('admin.notifications.index')->with('notifications', $notifications);
    }
881113
public void setNotifyDelete(boolean notify)  {
        addField(ConfigureNodeFields.notify_delete, FormField.Type.bool);
        setAnswer(ConfigureNodeFields.notify_delete.getFieldName(), notify);
    }