Hi,

I have some problems to use at the same time : containable behavior
class / paginator  class / my own search bar

I try to list data with a recursity of two or tree tables. I have
hasMany / belongsTo / HABTM relations which are declared in my models.

I try to use the search criteria to create a condition on my paginator
object.

My problem : containable behavior use only the tables directly
connected to my current model to generate the request.

When i add a request 'conditions' => 'level3.id = $id', there is an
error because the "level3" table is not included in the JOIN request.

For example :
Table1  belongsTo Table 2
Table 2 belongsTo Table 3.

In my search request, i try to add id_Table3 = x

I have declared the relation as below :

Table1_controller
{
    var $paginate=array(
        'contain'=>array(
                 'Table2' => array(
                    'Table3'
                   )
                );

    function index()
    {
       $this->set('result', $this->paginate('Table1','Table3.id=x'));
    }
}

and i have the following error : SQL Error: 1054: Unknown column
'Table3.id in 'where clause'

i have tried to add a "join" condition in my containable object. for
some request, it works but most of the time, i need to write dirty
request (i join a table twice).

Do you have any solution ?

Thanks

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to