PHP code example of madewithlove / broadway-mongodb
1. Go to this page and download the library: Download madewithlove/broadway-mongodb 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/ */
madewithlove / broadway-mongodb example snippets
$factory = new MongoDBClientFactory();
$client = $factory->create(['database' => 'foobar']);
$mongDBClientFactory = new MongoDBClientFactory();
$client = $factory->create(['database' => 'testing']);
$factory = new ReadModel\Factory(
new SimpleInterfaceSerializer(),
$client->selectDatabase('testing')
);
// 'my_projection' is the collection that will be used.
$repository = $factory->create('my_projector');
// If you have a custom read model repository you can use the factory to create your own instances:
$repository = $factory->create('my_projector', MyReadModelRepository::class);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.