The Doctrine channel is registering messages as a database record using the Doctrine ORM library.
If you want to use this channel, the DoctrineBundle
must be installed, enabled and configured.
yokai_messenger:
channels:
doctrine:
enabled: true
manager: default
yokai_messenger:
messages:
-
id: <up to you>
channels: doctrine # or [doctrine, <any other channels ...>]
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Yokai\MessengerBundle\DependencyInjection\Factory\MessageDefinitionFactory;
public function load(array $configs, ContainerBuilder $container)
{
MessageDefinitionFactory::create($container, '<up to you>', ['doctrine'], [], []);
}
This channel supports :
- objects that implements
Yokai\MessengerBundle\Recipient\DoctrineRecipientInterface
interface
This bundle is only responsible registering messages in a database (fetch messages and display it via the UI is up to you).
The entity you must ask for is Yokai\MessengerBundle\Entity\Notification
.
Attachments are handled and registered on database. The entity you must ask for is
Yokai\MessengerBundle\Entity\NotificationAttachment
.
Attachment names are registered on the database, files are put on a folder you have to defined for each messages with attachment.
yokai_messenger:
messages:
-
id: <up to you>
channels: doctrine # or [doctrine, <any other channels ...>]
defaults:
...
options:
doctrine:
attachments_path: '/path/to/your/folder'