You woudl create two associations using something like

var $belongsTo = array(
'Area1Translation' => array(
                        'className' => 'Translations',
                        'foreignKey' => 'item_area1_translationId',
                        'conditions' => '',
                        'fields' => '',
                        'order' => ''
                ) ,
'Area2Translation' => array(
                        'className' => 'Translations',
                        'foreignKey' => 'item_area2_translationId',
                        'conditions' => '',
                        'fields' => '',
                        'order' => ''
                )

Personally the field names and relations seem a bit odd, I would have
something like:

Item hasMany Area
Area hasMany Translation

HTH, Paul

On Sep 20, 10:31 am, heohni <[email protected]>
wrote:
> Hi,
>
> I have a table where I have certain content items per row.
> Together with this content items I have a translation ID per content
> item.
> That means I have a table row like this:
>
> item_area1 | item_area1_translationId | item_area2 |
> item_area2_translationId |
>
> When I create now my model for this content table, I want to associate
> the translation table, but I struggle with the fact that I have more
> than 1 id...
>
> class Contentobjekt extends AppModel {
> var $belongsTo = array(
> 'Translations' => array(
>                         'className' => 'Translations',
>                         'foreignKey' => 'item_area1_translationId',
>                         'conditions' => '',
>                         'fields' => '',
>                         'order' => ''
>                 )
>
> But how can I get access to item_area2_translationId,
> item_area3_translationId and so on from the same translations DB?
>
> Is my thought about the association wrong?
>
> Hope someone can help me out?!
>
> Thanks!!

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