On Sun, Jun 21, 2009 at 3:05 PM, David<[email protected]> wrote: > > I'm new to cakePHP and I don't know why my associations aren't > working. I'm trying to associate a game with a genre. Each game has > a genre_id column > (..) > <?php > class Game extends AppModel { > var $name = 'Game'; > var $hasOne = 'Genre'; > }
Your models are not correct. If Game has a genre_id column, in a CakePHP association you said that Game belongsTo Genre, so Genre hasOne (or hasMany, depending of your case) Game. http://book.cakephp.org/view/81/belongsTo Best regards. -- MARCELO DE F. ANDRADE Belem, PA, Amazonia, Brazil Linux User #221105 http://mfandrade.wordpress.com --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
