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

        $doctrineMessages = $this->repository->findBy(
                array('delivered' => false, 'queue' => $this->name), array('id' => 'ASC')
        );

        $messages = [];
        foreach ($doctrineMessages as $doctrineMessage) {
            $messages[] = new Message($doctrineMessage->getId(), $doctrineMessage->getMessage(), []);
            $doctrineMessage->setDelivered(true);
        }
        $this->em->flush();

        return $messages;
    }
public function receive(array $options = [])
    {
        if (!$this->em) {
            return [];
        }

        $doctrineMessages = $this->repository->findBy(
                array('delivered' => false, 'queue' => $this->name), array('id' => 'ASC')
        );

        $messages = [];
        foreach ($doctrineMessages as $doctrineMessage) {
            $messages[] = new Message($doctrineMessage->getId(), $doctrineMessage->getMessage(), []);
            $doctrineMessage->setDelivered(true);
        }
        $this->em->flush();

        return $messages;
    }
public function receive ( array $ options = [ ] ) { if ( ! $ this -> em ) { return [ ] ; } $ doctrineMessages = $ this -> repository -> findBy ( array ( 'delivered' => false , 'queue' => $ this -> name ) , array ( 'id' => 'ASC' ) ) ; $ messages = [ ] ; foreach ( $ doctrineMessages as $ doctrineMessage ) { $ messages [ ] = new Message ( $ doctrineMessage -> getId ( ) , $ doctrineMessage -> getMessage ( ) , [ ] ) ; $ doctrineMessage -> setDelivered ( true ) ; } $ this -> em -> flush ( ) ; return $ messages ; }
Polls the Queue for Messages

Depending on the Provider, this method may keep the connection open for
a configurable amount of time, to allow for long polling.  In most cases,
this method is not meant to be used to long poll indefinitely, but should
return in reasonable amount of time

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

@return array
Polls the Queue for Messages