Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hacfi/objectbridgebundle


https://github.com/hacfi/objectbridgebundle

Last synced: 2 months ago
JSON representation

Awesome Lists containing this project

README

        

hacfi Object Bridge Bundle
===

This bundle allows associations between different Doctrine ORMs and ODMs.

This project is at a experimental state and has limited functionality at the moment. It should work for Doctrine ORM to Doctrine PHPCR ODM, and vice versa (not ORM to ORM or PHPCR ODM to PHPCR ODM though).

The related objects are lazy-loaded if they haven’t been loaded by the object manager.

TODO:
---

- [x] Mapping via annotations
- [x] Bridge to and from Doctrine ORM entities
- [x] Bridge to and from Doctrine PHPCR ODM documents
- [ ] Specify correct dependencies in composer.json
- [ ] Use loadClassMetadata event to properly map fields (so you don’t have to add the string mapping yourself)
- [ ] Add support for XML and/or YAML mapping
- [ ] Create a registry for Doctrine mappers to make it extendable (MongoDB ODM & CouchDB ODM)
- [ ] Validate the mappings and make sure the mapper specified via ```type``` is available

Please note that the use-statement for the annotations has to be "use Hacfi\Bundle\ObjectBridgeBundle\Mapping\ObjectBridge;"
and doesn’t allow aliasing because the Doctrine’s SimpleAnnotationReader doesn’t support it. This might change in the future.

Install
---

app/AppKernel.php:

```php
new Hacfi\Bundle\ObjectBridgeBundle\HacfiObjectBridgeBundle(),
```

app/autoload.php:

```php
AnnotationRegistry::registerFile(__DIR__.'/../vendor/hacfi/object-bridge-bundle/Hacfi/Bundle/ObjectBridgeBundle/Mapping/ObjectBridge/Reference.php');
```

Example
---

/src/Hacfi/AppBundle/Entity/Product.php:

```php