PHP code example of tourze / doctrine-async-bundle
1. Go to this page and download the library: Download tourze/doctrine-async-bundle 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/ */
tourze / doctrine-async-bundle example snippets
use Tourze\DoctrineAsyncInsertBundle\Message\InsertTableMessage;
// Create an insert message
$message = new InsertTableMessage();
$message->setTableName('your_table');
$message->setParams([
'column1' => 'value1',
'column2' => ['array', 'will', 'be', 'json_encoded'],
]);
$message->setAllowDuplicate(false); // Set to true to ignore duplicate entry errors
// Dispatch the message using Symfony Messenger
$messageBus->dispatch($message);