src/Graviton/RabbitMqBundle/Listener/EventStatusLinkResponseListener.php
private function getStatusUrl($queueEvent)
    {
        // this has to be checked after cause we should not call getSubscribedWorkerIds() if above is true
        $workerIds = $this->getSubscribedWorkerIds($queueEvent);
        if (empty($workerIds)) {
            return '';
        }

        // we have subscribers; create the EventStatus entry
        /** @var EventStatus $eventStatus **/
        $eventStatus = new $this->eventStatusClassname();
        $eventStatus->setCreatedate(new \DateTime());
        $eventStatus->setEventname($queueEvent->getEvent());

        // if available, transport the ref document to the eventStatus instance
        if (!empty($queueEvent->getDocumenturl())) {
            $eventStatusResource = new $this->eventStatusEventResourceClassname();
            $eventStatusResource->setRef($this->extRefConverter->getExtReference($queueEvent->getDocumenturl()));
            $eventStatus->setEventresource($eventStatusResource);
        }

        foreach ($workerIds as $workerId) {
            /** @var \GravitonDyn\EventStatusBundle\Document\EventStatusStatus $eventStatusStatus **/
            $eventStatusStatus = new $this->eventStatusStatusClassname();
            $eventStatusStatus->setWorkerid($workerId);
            $eventStatusStatus->setStatus('opened');
            $eventStatus->addStatus($eventStatusStatus);
        }

        // Set username to Event
        $eventStatus->setUserid($this->getSecurityUsername());

        $this->documentManager->persist($eventStatus);
        $this->documentManager->flush();

        // get the url..
        $url = $this->router->generate(
            $this->eventStatusRouteName,
            [
                'id' => $eventStatus->getId()
            ],
            UrlGeneratorInterface::ABSOLUTE_URL
        );

        return $url;
    }
private function getStatusUrl($queueEvent)
    {
        // this has to be checked after cause we should not call getSubscribedWorkerIds() if above is true
        $workerIds = $this->getSubscribedWorkerIds($queueEvent);
        if (empty($workerIds)) {
            return '';
        }

        // we have subscribers; create the EventStatus entry
        /** @var EventStatus $eventStatus **/
        $eventStatus = new $this->eventStatusClassname();
        $eventStatus->setCreatedate(new \DateTime());
        $eventStatus->setEventname($queueEvent->getEvent());

        // if available, transport the ref document to the eventStatus instance
        if (!empty($queueEvent->getDocumenturl())) {
            $eventStatusResource = new $this->eventStatusEventResourceClassname();
            $eventStatusResource->setRef($this->extRefConverter->getExtReference($queueEvent->getDocumenturl()));
            $eventStatus->setEventresource($eventStatusResource);
        }

        foreach ($workerIds as $workerId) {
            /** @var \GravitonDyn\EventStatusBundle\Document\EventStatusStatus $eventStatusStatus **/
            $eventStatusStatus = new $this->eventStatusStatusClassname();
            $eventStatusStatus->setWorkerid($workerId);
            $eventStatusStatus->setStatus('opened');
            $eventStatus->addStatus($eventStatusStatus);
        }

        // Set username to Event
        $eventStatus->setUserid($this->getSecurityUsername());

        $this->documentManager->persist($eventStatus);
        $this->documentManager->flush();

        // get the url..
        $url = $this->router->generate(
            $this->eventStatusRouteName,
            [
                'id' => $eventStatus->getId()
            ],
            UrlGeneratorInterface::ABSOLUTE_URL
        );

        return $url;
    }
private function getStatusUrl ( $ queueEvent ) { // this has to be checked after cause we should not call getSubscribedWorkerIds() if above is true $ workerIds = $ this -> getSubscribedWorkerIds ( $ queueEvent ) ; if ( empty ( $ workerIds ) ) { return '' ; } // we have subscribers; create the EventStatus entry /** @var EventStatus $eventStatus **/ $ eventStatus = new $ this -> eventStatusClassname ( ) ; $ eventStatus -> setCreatedate ( new \ DateTime ( ) ) ; $ eventStatus -> setEventname ( $ queueEvent -> getEvent ( ) ) ; // if available, transport the ref document to the eventStatus instance if ( ! empty ( $ queueEvent -> getDocumenturl ( ) ) ) { $ eventStatusResource = new $ this -> eventStatusEventResourceClassname ( ) ; $ eventStatusResource -> setRef ( $ this -> extRefConverter -> getExtReference ( $ queueEvent -> getDocumenturl ( ) ) ) ; $ eventStatus -> setEventresource ( $ eventStatusResource ) ; } foreach ( $ workerIds as $ workerId ) { /** @var \GravitonDyn\EventStatusBundle\Document\EventStatusStatus $eventStatusStatus **/ $ eventStatusStatus = new $ this -> eventStatusStatusClassname ( ) ; $ eventStatusStatus -> setWorkerid ( $ workerId ) ; $ eventStatusStatus -> setStatus ( 'opened' ) ; $ eventStatus -> addStatus ( $ eventStatusStatus ) ; } // Set username to Event $ eventStatus -> setUserid ( $ this -> getSecurityUsername ( ) ) ; $ this -> documentManager -> persist ( $ eventStatus ) ; $ this -> documentManager -> flush ( ) ; // get the url.. $ url = $ this -> router -> generate ( $ this -> eventStatusRouteName , [ 'id' => $ eventStatus -> getId ( ) ] , UrlGeneratorInterface :: ABSOLUTE_URL ) ; return $ url ; }
Creates a EventStatus object that gets persisted..

@param QueueEvent $queueEvent queueEvent object

@return string
Creates a EventStatus object that gets persisted ..