[FLOW3-general] FLOW3 Application on top of existing database
Karsten Dambekalns
karsten at typo3.org
Wed Apr 25 11:08:39 CEST 2012
Hi.
On 24.04.12 10:30, Alexander Dick wrote:
> This existing application should be extended by another (independent)
> FLOW3 application. The only thing is that I have to access it's database
> tables and process the data - only for reading
You create models with the properties as you need them to do the
processing. Then you use the "Table" and "Column" annotations provided
by Doctrine to map those properties to specific table and field names
(if needed).
For associations you can use "JoinTable" and "JoinColumn" annotations in
pretty much the same way.
For added safety you can declare your entities "ReadOnly" to make sure
the existing data is really never changed.
> the new application has it's own persistence storage.
Um, can you explain that? If that means you want to use two different
databases simultaneously, your are out of luck. Right now FLOW3 doesn't
do that…
You can create models as usual for the "external" data and code a
repository that connects directly to the existing database to read data.
A bit more work, but a nice way to encapsulate that workaround and later
easily refactor (when FLOW3 eventually supports multiple connections).
Regards,
Karsten
--
Karsten Dambekalns
TYPO3 Core Developer, FLOW3 / Phoenix Team
TYPO3 .... inspiring people to share!
Get involved: typo3.org
More information about the FLOW3-general
mailing list