Skip to content
This repository was archived by the owner on Aug 31, 2020. It is now read-only.

Latest commit

 

History

History
91 lines (64 loc) · 2.06 KB

doctrine.md

File metadata and controls

91 lines (64 loc) · 2.06 KB

Doctrine Channel

Purpose

The Doctrine channel is registering messages as a database record using the Doctrine ORM library.

Requirements

If you want to use this channel, the DoctrineBundle must be installed, enabled and configured.

See Symfony's documentation.

Configuration

Channel configuration

yokai_messenger:
    channels:
        doctrine:
            enabled: true
            manager: default

Messages configuration

yokai_messenger:
    messages:
        -
            id:       <up to you>
            channels: doctrine # or [doctrine, <any other channels ...>]

Registering messages manually

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'], [], []);
}

Recipient

This channel supports :

  • objects that implements Yokai\MessengerBundle\Recipient\DoctrineRecipientInterface interface

Specificities

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'