0

I'm currently developing an application in Symfony2.6 (first time using it) which basically is an new management system of an existing database of objects. While the management (users, roles, routes etc) uses a new orm database, the objects are stored in an seperated database.

The object database also has a read only flag on some tables and gets modified by external staff, so an ORM on this database would be a bad idea.

But: I still want to have an (aggregated) entity of these objects which I can query and populate, also with writing back to specific tables and binding to forms. Is there any best practice for achieving this?

EDIT: Essentially I want to have this:

Table1:

col11 col12 col13 col14

Table2:

col21 col22 col23 col24

Now I only want an object composed of col11, col14, col22, col24. How do I do this and how is it possible to populate and update via entity manager?

Adan0s
  • 23
  • 5
  • [How to generate entities based on an existing database](http://symfony.com/doc/current/cookbook/doctrine/reverse_engineering.html) – sjagr Feb 09 '15 at 18:14
  • Thanks, but that's not exactly what I need. For example, I need an entity existing out of values from multiple tables. – Adan0s Feb 10 '15 at 07:51
  • You mean [Inheritance Mapping](http://doctrine-orm.readthedocs.org/en/latest/reference/inheritance-mapping.html)? – sjagr Feb 10 '15 at 14:12
  • I guess kind of. Please see my edit above. – Adan0s Feb 11 '15 at 12:29

1 Answers1

0

Best practice - to use two separate entity managers for each connection and enjoy all the benefits from ORM;-)

Michael Sivolobov
  • 12,388
  • 3
  • 43
  • 64