Naturally .... not too long after I post I come across the Core
Behavior "Containable" (http://book.cakephp.org/view/474/Containable).
Same thing ... different name .... hopefully.

On Sep 22, 7:15 pm, Brenton B <[EMAIL PROTECTED]> wrote:
> I'm guessing this might be what's 
> needed:http://bakery.cakephp.org/articles/view/bindable-behavior-control-you...
>
> Will check it out ...
>
> On Sep 22, 6:58 pm, Brenton B <[EMAIL PROTECTED]> wrote:
>
> > Still trying to wrap my head around Cake's intricacies ... and get RoR
> > conventions out of my head ...
>
> > So I've got a User
> > I've also got WebpageType (ex: Main, Bio, Blog, etc.)
> > I then have these 2 tables linked, which has an extra field for the
> > URL.
>
> > I've set this all up using HABTM and `with`.
>
> > All well and good, except if I have multiple of the same type of
> > webpage, in which case it only returns the first row of each unique
> > type. doh!!
>
> > Personally I think the HABTM + `with` doesn't really make much sense -
> > it's a bit reverse because it's getting the WebpageType with the join
> > attached. For example, in this specific circumstance I want a user and
> > all of the users webpages with the name of the type attached.
>
> > Now, of course, I could do increase how recursive it is, but it
> > obviously gets a few more levels than I want (because there are some
> > other tables that are joined that would end up retrieving the user
> > again). Or I could do some fancy juggling and bind some models
> > together dynamically, but that's adding some complexity on top of what
> > I figure should be fairly straight forward.
>
> > Keep in mind that I'm coming from a RoR background, where there is
> > something similar to the `with` fanciness; however, it's in the
> > retrieving. So when retrieving a record, you can specify which
> > associations to retrieve - most importantly, this is done as a
> > parameter in options:
>
> > user->find('first', array('with' => array('UserWebpageType' =>
> > array('WebpageType'))));
>
> > Something I'm missing?
>
> > Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to