Hello all!

I've been programming in PHP for a while now but just started to use Cake
in this new project I'm working.
I have 3 Table I'd like to Associate together: Movies, Actors and Cast

My Movie Model is set the following way:

*public $hasAndBelongsToMany = array(*

*'Elenco' => array(*

*'className'              => 'Personalidade',*

*'joinTable'              => 'filmes_personalidades',*

*'foreignKey'             => 'filme_id',*

*'associationForeignKey'  => 'personalidade_id',*

*'unique'                 => true,*

*'fields' => 'id,nome'*

*)*

);


When I use $this->Filme->find('all') it works fine and all the Actors are
selected correctly.
But when I try to filter movies that have a selected actor using:

*$this->set('filmes', $this->Filme->find('all', array(*

*'conditions' => array("Elenco.id" => array($personalidade_id)),*

*'limit' => 20,*

*'page' => $pagina*

*)));*


Cake tells me "*SQLSTATE[42S22]:* Column not found: 1054 Unknown column
'Elenco.id' in 'where clause'".

What am I doing wrong?
Thanks for the support in advance!

Fernando Nery Filho*
*

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to