What does the find() code look like?

It's possible that the problem is with your unconventional column
names. It might work better if you use, eg. 'areainteresse_pessoa' for
the join table and 'pessoa_id' for the key.

Or it might be something else.

On Fri, Sep 25, 2009 at 11:30 AM, Wladiston Paiva
<[email protected]> wrote:
> hi peoples,
>
> i have two models is cakephp:
>
>
> class Pessoa extends AppModel {
>     var $name = 'Pessoa';
>     var $primaryKey = 'codigo';
>
>     var $hasAndBelongsToMany = array(
>         'Areainteresse' =>
>             array(
>                 'className'            => 'Areainteresse',
>                 'joinTable'              => 'areainteressepessoa',
>                 'foreignKey'             => 'codigopessoa',
>                 'associationForeignKey'  => 'codigoareainteresse'
>             )
>         );
> }
>
>
> and
>
> class Areainteresse extends AppModel {
>     var $name = 'Areainteresse';
>     var $useTable = 'areainteresse';
>     var $primaryKey = 'codigo';
> }
>
> when i run the $this-Pessoa->find(). he return me:
>
> array(2) {
>   [0]=>
>   array(12) {
>     ["codigo"]=>
>     int(6)
>   }
>   ["Areainteresse"]=>
>   array(0) {
>   }
> }
>
> the Pessoa entity is returned normally, however the entity Areainteresse not
> returned.
> This only for the find(). the save() work normally.
> The data are in the table correctly.
>
> Anyone have any solution?
>
> ---
> Wladiston Maurício de Paiva
> http://wladistonpaiva.com.br
> [email protected]
> [email protected]
> +55 (31) 8435 - 5380
>
> >
>

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