yodi,
this hasn't been working for me. When I remove all search conditions,
I get the containable behavior to work, but once I start putting in
search conditions, it stops working. Here is the code I got working,
all models have actsAs = 'containable' in them. I have taken your
example and simplified it with other examples from the web.
$this->paginate = array(
'contain' => array
('RegistrationCode','RegistrationCode.Code'),
'page' => $page);
This works fine and is pulling the correct data. Once I add the
conditions:
$this->paginate = array(
'conditions' => $conditions,
'contain' => array
('RegistrationCode','RegistrationCode.Code'),
'page' => $page);
It stops working completely. The condiitons array is very standard.
It's a big OR array.
array(OR' => array('Registration.name LIKE' => $searchField."%",
etc...
Once I drop that in there, no containable data is returned. The
['RegistrationCode'] array is empty. Any thoughts on why this might be
happening?
On Apr 17, 9:44 pm, yodi <[email protected]> wrote:
> Oopss, i'm forgot Registration, here :
>
> function paginateSearch($id = array())
> {
> $this->recursive = '0';
> $result = array('fields'=>'Code.id,Code.name',
> 'contain' =>array('RegistrationCodes'=>array(
> 'fields'=>array('RegistrationCodes.id, RegistrationCodes.code_id,
> RegistrationCodes.registration_id'),
> 'Registration'
> )),
> 'limit' => 10
> );
>
> return $result;
> }
>
> On Sat, 2009-04-18 at 08:39 +0700, yodi wrote:
> > function paginateSearch($id = array())
> > {
> > $this->recursive = '0';
> > $result = array(fields'=>'Code.id,Code.name',
> > 'contain' =>
> > array('RegistrationCodes'=>array(
> >
> > 'fields'=>array('RegistrationCodes.id,RegistrationCodes.code_id,RegistrationCodes.registration_id'),
> > )),
> > 'limit' => 10
> > );
>
> > return $result;
> > }
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---