PHP code example of tbcd / multi-dynamic-messenger

1. Go to this page and download the library: Download tbcd/multi-dynamic-messenger library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

tbcd / multi-dynamic-messenger example snippets


# src\Messenger\EntityTransportDataProvider.php

class EntityTransportDataProvider implements TransportDataProviderInterface
{

    public function getAll(): array
    {
        $entities = $this->em->getRepository(TransportEntity::class)->findAll();
        return array_map(function(TransportEntity $entity) {
            return new TransportData($entity->getName(), $entity->getDsn(), $entity->getOptions());
        }, $entities);
    }
}