[FLOW3-general] FLOW3 / MySQL

Thomas Layh thomas at layh.com
Tue Oct 12 16:25:56 CEST 2010


Hi Michael,

thank you very much for your reply.

It is working now. I am not sure but I think I discovered a small error in
the getting started tutorial.

On page:
http://flow3.typo3.org/documentation/tutorials/getting-started/gettingstarted.controller/
they say to use
$this->objectFactory->create('\F3\Whatever');
but this results in an error. After checking the documentation I found out
that they say to use:
$this->objectManager->create('\F3\Whatever');
and this works for me.

I really have to get rid of the old way to think a little bit.

But there is another small problem. For a completely new project everything
is fine. But what if I already have database tables and want to reuse them.
Do I have to import them by writing a setupController and putting all data
there? Or writing some custom sql to get the data and transfer it to the new
structure?

Thanks again very much for your help.
Greetings,
Thomas Layh



On Tue, Oct 12, 2010 at 15:46, Michael Sauter <mail at michaelsauter.net>wrote:

> Hi Thomas,
>
> you need to get rid of the notion that there needs to be a table for every
> model. FLOW3 stores the information in another way. All you ever need as a
> database structure is already in the DDL.sql. Basically, it has a table in
> which it stores all the entities, but the properties and their data of the
> entities is stored in 2 different tables. That way, you can store every
> model in this structure and you can change your model "schema" without the
> need to change something in the DB structure.
>
> Have you tried and added a Book object to your BookRepository? Because so
> far, what you describe sounds perfectly fine. It returns an empty result
> because probably there are no books yet.
>
> Just see the BlogExample or the Manual for an example on how to add objects
> (and how they get persisted).
>
> Or did you expect to get books back and that doesn't work?
>
> ~michael
>
> _______________________________________________
> FLOW3-general mailing list
> FLOW3-general at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/flow3-general
>


More information about the FLOW3-general mailing list