src/Provider/DoctrineProvider.php
public function publish(array $message, array $options = [])
    {
        if (!$this->em) {
            return '';
        }

        $doctrineMessage = new DoctrineMessage();
        $doctrineMessage->setQueue($this->name)
                ->setDelivered(false)
                ->setMessage($message)
                ->setLength(strlen(serialize($message)));

        $this->em->persist($doctrineMessage);
        $this->em->flush();

        return (string) $doctrineMessage->getId();
    }
public function publish(array $message, array $options = [])
    {
        if (!$this->em) {
            return '';
        }

        $doctrineMessage = new DoctrineMessage();
        $doctrineMessage->setQueue($this->name)
                ->setDelivered(false)
                ->setMessage($message)
                ->setLength(strlen(serialize($message)));

        $this->em->persist($doctrineMessage);
        $this->em->flush();

        return (string) $doctrineMessage->getId();
    }
public function publish ( array $ message , array $ options = [ ] ) { if ( ! $ this -> em ) { return '' ; } $ doctrineMessage = new DoctrineMessage ( ) ; $ doctrineMessage -> setQueue ( $ this -> name ) -> setDelivered ( false ) -> setMessage ( $ message ) -> setLength ( strlen ( serialize ( $ message ) ) ) ; $ this -> em -> persist ( $ doctrineMessage ) ; $ this -> em -> flush ( ) ; return ( string ) $ doctrineMessage -> getId ( ) ; }
Publishes a message to the Queue

This method should return a string MessageId or Response

@param array $message The message to queue
@param array $options An array of options that override the queue defaults

@return string
Publishes a message to the Queue