PHP code example of webfactory / content-mapping-destinationadapter-solarium-bundle
1. Go to this page and download the library: Download webfactory/content-mapping-destinationadapter-solarium-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/ */
webfactory / content-mapping-destinationadapter-solarium-bundle example snippets
# Resources/config/services.php
return static function(ContainerConfigurator $container) {
$services = $container->services();
$services->set('my_entity_synchronizer', \Webfactory\ContentMapping\Synchronizer::class)
->args([
inline_service('Webfactory\ContentMapping\SourceAdapter\Doctrine\GenericDoctrineSourceAdapter')
->args([
inline_service('MyVendor\MyBundle\Entity\MyEntityRepository'),
'findForSolrIndex',
]),
inline_service('MyVendor\MyBundle\ContentMapping\MyEntityMapper'),
service('contentmapping.destinationadapter.solarium'),
service('logger'),
])
->tag('monolog.logger', ['channel' => 'solr'])
->tag('contentmapping.synchronizer', ['objectclass' => 'my-object-class']);
// other synchronizers here
};