Friday, January 27, 2012

Use DB view for model in Cake 2.0

I'm using a basic model following Cake PHP conventions. The model is
using a view instead of a table in the database, which always worked
in Cake 1.3, but since I upgraded to 2.0 I get "Error: Database table
cameras for model Camera was not found." That's the right model and
that view exists in the database. If I select the view into a table of
the same name, the model works. All my models based on tables work
fine as well.

How can I use a database view rather than a table in a Cake 2.0 model?

I also posted this stack overflow question:
http://stackoverflow.com/questions/9025096/use-a-database-view-for-a-model-in-cakephp-2-0
but no one there seems to know.

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: