Re: CakePHP Model Advice

2009-01-29 Thread Webweave
OK, just an observation, but first your ID is 0, which doesn't make sense for an ID value. But assuming that's OK for a moment, what is the result if you query the ingredients_recipes table directly for recipe_id of 0. On Jan 29, 10:11 am, matth wrote: > Sure thing. > > My recipes controller v

Re: CakePHP Model Advice

2009-01-29 Thread brian
Are you certain that you have at least one row in ingredients_recipes with a recipe_id equal to ... hey, wait a minute--your recipe ID is 0. That's not right at all! You'll need to clear that up, first. How did you put that recipe data into the DB? If it was through a Cake form, something's likel

Re: CakePHP Model Advice

2009-01-29 Thread matth
Sure thing. My recipes controller view function: function view($id = null) { $this->set('recipe', $this->Recipe->findById($id)); } My recipes/view.ctp debug output: Array ( [Recipe] => Array ( [id] => 0 [created] => 2009-01-21 22:49:23 [n

Re: CakePHP Model Advice

2009-01-29 Thread Webweave
What are you seeing in the debug data for your Recipe find? Post the controller code where you do the find, and what the data output is, and it will be easier for someone to answer your question. On Jan 28, 1:29 pm, matth wrote: > Thanks for that tidbit about the Ingredient model. > > I gave re

Re: CakePHP Model Advice

2009-01-28 Thread matth
Thanks for that tidbit about the Ingredient model. I gave recursive a shot earlier in the day but that didn't help. At the moment, this is exactly what I'm working with: class Recipe extends AppModel { var $name = 'Recipe'; var $primaryKey = 'id'; var $recursive = 2;

Re: CakePHP Model Advice

2009-01-28 Thread yusuf widi
no, it is ok if your ingredient model is empty... try to give recursive parameter with '2' when you use find method. by default recursive parameter is null. read more about recursive is on the api.cakephp.org http://api.cakephp.org/class/model#method-Modelfind On Thu, Jan 29, 2009 at 4:46 AM, ma

CakePHP Model Advice

2009-01-28 Thread matth
Howdy, I'm having trouble fully wrapping my head around Cake's models. They seem great and I'm really working to figure out how to take advantage of all the benefits. However, I can't quite figure out how to set up my models appropriately. For example, I have two models (Recipe and Ingredient) an