You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to write a custom provider which uses a DB via Doctrine to queue and persist the messages. I've run some tests using the sync driver which works fine. I've now implemented the beginning of the custom provider by implementing ProviderInterface. However when I try to use the new custom queue I get the following message
Warning: Missing argument 1 for AppBundle\QPush\DoctrineProvider::__construct(), called in /Users/sbrookes/Development/symfony/app/cache/dev/appDevDebugProjectContainer.php on line 1839 and defined
As if the customer provider isn't calling the constructor with any arguments.
Any ideas or some working code that implements a custom provider I can work from?
use Doctrine\Common\Cache\Cache;
use Symfony\Bridge\Monolog\Logger;
use AppBundle\Entity\DoctrineMessage;
use Uecode\Bundle\QPushBundle\Event\MessageEvent;
use Uecode\Bundle\QPushBundle\Message\Message;
use Uecode\Bundle\QPushBundle\Provider\ProviderInterface;
class DoctrineProvider implements ProviderInterface {
protected $em;
/**
* Constructor for Provider classes
*
* @param string $name Name of the Queue the provider is for
* @param array $options An array of configuration options for the Queue
* @param mixed $client A Queue Client for the provider
* @param Cache $cache An instance of Doctrine\Common\Cache\Cache
* @param Logger $logger An instance of Symfony\Bridge\Mongolog\Logger
*/
public function __construct($name, array $options, $client, Cache $cache, Logger $logger)
{
$this->name = $name;
$this->options = $options;
$this->cache = $cache;
$this->logger = $logger;
$this->em = $this->getDoctrine()->getManager();
}
I'd be very happy with your working solution as is and rework it as needed, since we're in a situation using the file provider and it backfiring on us due to filesystem rights. So I'd have to implement it myself anyway if I can't use yours.
Activity
odinns commentedon Jun 6, 2016
Hi there! I am interested in your solution for this. Have you completed the provider in the mean time?
odinns commentedon Jun 7, 2016
Alright. Well I am still adjusting to Symfony after a some time on Laravel, so I can't really tell if it's the right way :-)
odinns commentedon Jun 30, 2016
Any progress on this? We could use this for a project here, and I'd like to help finishing the DoctrineProvider if you'll allow me :-)
odinns commentedon Jun 30, 2016
I'd be very happy with your working solution as is and rework it as needed, since we're in a situation using the file provider and it backfiring on us due to filesystem rights. So I'd have to implement it myself anyway if I can't use yours.