Entity composition from multiple storages

Notice: This thread is very old.
echo
Member | 134
+
0
-

Hello,
I have entity relations stored in a graph db (Neo4j), some properties in MySQL and I need to compose the raw data from the strorages into a single object.

Is there a php OAM framework (object “anything” mapping) somewhere which would allow me to perform selections over entity properties regardless of where are the property stored?

Thanks

Last edited by echo (2014-06-07 22:17)

Mikulas Dite
Member | 756
+
+1
-

I've recently solved this for one project. In any good ORM – in my case http://orm.petrprochazka.com/ – you can implement your own mapper, or hook the hydrate/persist events.

Might might use the mysql mapper that presumably comes with any php orm and simply propagate relations and any additional attributes to neo4j. When you load the entities, again you just use the mysql mapper and hydrate with both mysql and neo4j data.

Example: create a new node whenever a new entity is persisted https://github.com/…o4jTrait.php#…

Last edited by Mikulas Dite (2014-06-07 22:46)