Yes you can
For belongsTo:
var $belongsTo = array( 
        'BelongClass' => array(
          'classname'      => 'BelongClass',
          'foreignKey'     => 'your_foreign_key_field_id'
        )
      );

  var $hasMany = array(
        'HasManyClass' => array(
          'className'   => 'HasManyClass',
          'foreignKey'  => 'your_foreign_key_field_id'
        );
   

> -----Messaggio originale-----
> Da: [email protected] 
> [mailto:[EMAIL PROTECTED] Per conto di korcs
> Inviato: domenica 18 marzo 2007 14.59
> A: Cake PHP
> Oggetto: Overriding foreign key conventions
> 
> 
> Hi Bakers,
> 
> i have  a database table (table name: 'relations') which 
> related to other tables via a foreign key (field name: 
> related_table_id). I want, that whenever i fetch an entry 
> from the table 'relation', the associated table entry will be 
> fetched as well (like the posts and comments in the manual). 
> The problem is, that I should name this field like <related 
> table name>_id, but i have 7 different tables related to the 
> table 'relation'. Do you have any idea, how could i solve 
> this problem?
> 
> Regards,
> 
> Korcs
> 
> 
> > 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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