Re: How to perform find without redundant model name in results array

2008-06-17 Thread b logica
On Fri, Jun 13, 2008 at 8:34 PM, Tim Fisken [EMAIL PROTECTED] wrote: On Jun 12, 12:54 pm, AD7six [EMAIL PROTECTED] wrote: It's redundant only if you have no model associations unless you want to risk for example, Post.comment being impossible to access. But shouldn't this logic also apply

Re: How to perform find without redundant model name in results array

2008-06-17 Thread Tim Fisken
On Jun 17, 9:24 am, b logica [EMAIL PROTECTED] wrote: On Fri, Jun 13, 2008 at 8:34 PM, Tim Fisken [EMAIL PROTECTED] wrote: this case. Odd as it might seem, it would be better, and more consistent, if Cake produced an array like this: $post['Comment'][0]['Comment']['author']

Re: How to perform find without redundant model name in results array

2008-06-14 Thread Tim Fisken
On Jun 12, 12:54 pm, AD7six [EMAIL PROTECTED] wrote: It's redundant only if you have no model associations unless you want to risk for example, Post.comment being impossible to access. But shouldn't this logic also apply to associated models. Currently, if you have a post and its comments, you

Re: How to perform find without redundant model name in results array

2008-06-13 Thread RichardAtHome
If you don't like it (and you have no other model associations as mentioned by AD7) you can change it in the controller: $post = $this-Post-find(); $post = $post['Post']; On Jun 12, 8:54 pm, AD7six [EMAIL PROTECTED] wrote: On Jun 12, 9:44 pm, zw [EMAIL PROTECTED] wrote: I've been using

Re: How to perform find without redundant model name in results array

2008-06-13 Thread zw
Thanks for the tip, I've done that before when finding a single object, but that won't work for an array. I'll just work on writing something in the model that loops through the results and returns an array without the model name. On Jun 13, 6:28 am, RichardAtHome [EMAIL PROTECTED] wrote: If

Re: How to perform find without redundant model name in results array

2008-06-13 Thread francky06l
Check the set::extract, you might find something working for your needs.. ( have a look in the test cases, they are usually a very good tutorial :-) On Jun 13, 11:13 pm, zw [EMAIL PROTECTED] wrote: Thanks for the tip, I've done that before when finding a single object, but that won't work for

How to perform find without redundant model name in results array

2008-06-12 Thread zw
I've been using CakePHP for a few projects and really think it's a great frameworks except one thing. I can't get my head around why all results have the model name in the associative array. I don't see any benefit of doing this. If you're trying to get a Post object and you do: $post =

Re: How to perform find without redundant model name in results array

2008-06-12 Thread AD7six
On Jun 12, 9:44 pm, zw [EMAIL PROTECTED] wrote: I've been using CakePHP for a few projects and really think it's a great frameworks except one thing. I can't get my head around why all results have the model name in the associative array. I don't see any benefit of doing this. If you're