Re: $conditions 'reset' key in terms of Containable

2009-06-16 Thread eric.winch...@gmail.com

Arrghh I'm feeling stupid now. Here's how you use HABTM Containable
and paginate all at once:

$this->paginate['AreaAlbum'] = array(
'conditions'=>$conditions,
'limit' => 4,
'page' => 1,
'order'=>'AreaAlbum.album_id desc',
'contain'=>array('Album'=>array('User'=>array('first_name',
'last_name', 'id'), 'CoverImage'=>array('WebResource', 'FileType')))
);

$albums = $this->paginate('AreaAlbum');


This is what I was trying to do before:

$this->AreaAlbum->contain('Album.User.first_name',
'Album.User.last_name', 'Album.User.id',
'Album.CoverImage.WebResource', 'Album.CoverImage.FileType');
$albums = $this->paginate('AreaAlbum');

Apparently the array format + $conditions is the way to go with
paginate.

On Jun 16, 11:55 pm, "eric.winch...@gmail.com"
 wrote:
> Not documented as far as I know. It's just Containable weirdness,
> probably having to do with binding.
>
> Anyone know why Containable doesn't work with HABTM 'with'
> relationships? I had it working when it was a 3rd party behavior, but
> it's definitely not working now. For me, "deep" SQL queries is the
> most frustrating part of using Cake.
>
> On Jun 16, 11:37 pm, brian  wrote:
>
>
>
> > There's a 'reset' param? Is that documented anywhere?
>
> > On Tue, Jun 16, 2009 at 11:23 PM,
>
> > eric.winch...@gmail.com wrote:
>
> > > Can anyone describe why 'reset'=>false must be in $conditions for
> > > Containable usage of any complexity? I have queries that go from
> > > taking an unbearable 20 seconds to an almost unbearable 3 seconds, but
> > > I don't understand what 'reset' has to do with it. The ones where it
> > > really counts are using up to 3 levels of recursiveness.
--~--~-~--~~~---~--~~
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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: $conditions 'reset' key in terms of Containable

2009-06-16 Thread eric.winch...@gmail.com

Not documented as far as I know. It's just Containable weirdness,
probably having to do with binding.

Anyone know why Containable doesn't work with HABTM 'with'
relationships? I had it working when it was a 3rd party behavior, but
it's definitely not working now. For me, "deep" SQL queries is the
most frustrating part of using Cake.

On Jun 16, 11:37 pm, brian  wrote:
> There's a 'reset' param? Is that documented anywhere?
>
> On Tue, Jun 16, 2009 at 11:23 PM,
>
>
>
> eric.winch...@gmail.com wrote:
>
> > Can anyone describe why 'reset'=>false must be in $conditions for
> > Containable usage of any complexity? I have queries that go from
> > taking an unbearable 20 seconds to an almost unbearable 3 seconds, but
> > I don't understand what 'reset' has to do with it. The ones where it
> > really counts are using up to 3 levels of recursiveness.
--~--~-~--~~~---~--~~
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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: $conditions 'reset' key in terms of Containable

2009-06-16 Thread brian

There's a 'reset' param? Is that documented anywhere?

On Tue, Jun 16, 2009 at 11:23 PM,
eric.winch...@gmail.com wrote:
>
> Can anyone describe why 'reset'=>false must be in $conditions for
> Containable usage of any complexity? I have queries that go from
> taking an unbearable 20 seconds to an almost unbearable 3 seconds, but
> I don't understand what 'reset' has to do with it. The ones where it
> really counts are using up to 3 levels of recursiveness.
> >
>

--~--~-~--~~~---~--~~
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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: $conditions 'reset' key in terms of Containable

2009-06-16 Thread eric.winch...@gmail.com

Something I just discovered and maybe the more important question -
why doesn't Containable work on HABTM 'with' relationships?

On Jun 16, 10:23 pm, "eric.winch...@gmail.com"
 wrote:
> Can anyone describe why 'reset'=>false must be in $conditions for
> Containable usage of any complexity? I have queries that go from
> taking an unbearable 20 seconds to an almost unbearable 3 seconds, but
> I don't understand what 'reset' has to do with it. The ones where it
> really counts are using up to 3 levels of recursiveness.
--~--~-~--~~~---~--~~
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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---