FuelPHP ORM y generador de consultas

I recently started a project based on FuelPHP. So on this site I will have lot of relations.

My question is, is it a good idea to use the query builder and the ORM?

For example would I use the ORM only for relations, and use the query builder to insert update and delete records in the database.

Or is this not a good idea?

preguntado el 01 de septiembre de 12 a las 07:09

2 Respuestas

The ORM is fairly powerful; it has Create, Read, Update and Delete (CRUD) functionality. http://docs.fuelphp.com/packages/orm/crud.html built into it so it should be possible to use the ORM for the most part. Saying that, I am currently working on a project where we have elected to use both the ORM and the query builder.

There is a thread on the FuelPHP forums that discusses this: http://fuelphp.com/forums/topics/view/7345

Respondido el 03 de Septiembre de 12 a las 10:09

In general not a problem, but you have to take into account that the ORM does result caching (on a per request basis).

So if you run an ORM query to retrieve records, then run a QB query to modify those records, the ORM will still return the unmodified versions. Even if you run the same ORM query again (as it will see the data is cached, and will not run another query to retrieve them).

Respondido el 03 de Septiembre de 12 a las 13:09

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.