1. Go to this page and download the library: Download mapado/doctrine-blender 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/ */
mapado / doctrine-blender example snippets
use Mapado\DoctrineBlender\ObjectBlender;
use Mapado\DoctrineBlender\ExternalAssociation;
$documentManager = ... // get a document manager
$entityManager = ... // get an entity manager
$eventSubscriber = new ObjectBlender;
$eventSubscriber->mapExternalAssociation(
new ExternalAssociation(
$entityManager,
'Acme\Entity\Order',
'product',
$documentManager,
'Acme\Document\Product',
'getProductId', // optional, auto-generated with the property name
'setProduct' // optional, auto-generated with the property name
)
);
use Mapado\DoctrineBlender\ObjectBlender;
use Mapado\DoctrineBlender\ExternalAssociation;
$entityManager = ... // get an entity manager
$secondEntityManager = ... // get the second manager
$eventSubscriber = new ObjectBlender;
$eventSubscriber->mapExternalAssociation(
new ExternalAssociation(
$entityManager,
'Acme\Entity\Order',
'product',
$secondEntityManager,
'Acme\Document\Product'
)
);
use Mapado\DoctrineBlender\Configuration\YamlConfiguration;
$ymlConf = new YamlConfiguration('/path/to/external_association.yml');
$entityManager = ... // get an entity manager
$documentManager = ... // get a document manager
$ymlConf->setObjectManagerReference('product_em', $entityManager)
->setObjectManagerReference('order_dm', $documentManager)
;
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.