Thanks i do know how to set up relationships my question did prob  
seem quite basic.

The problem with your suggestion is say my customer comes along and  
now wants the site in french as well as spanish, catalan, italian and  
dutch. I would have to go and add all the fields into each table.  
Plus i was using a simple table as a example there will be maybe five  
fields in a table that will have a translation.

I have worked it out without using bind.

var $belongsTo = array(
                        'Template' => array('className' => 'Template',
                                                                'foreignKey' => 
'template_id',
                                                                'conditions' => 
'',
                                                                'fields' => 
'name',
                                                                'order' => '',
                                                                'counterCache' 
=> ''),
                        'Title' => array('className' => 'ContentEnglish',
                                                                          
'foreignKey' => 'title',
                                                                          
'conditions' => '',
                                                                          
'fields' => 'content',
                                                                          
'order' => '',
                                                                          
'counterCache' => ''),
                        'Content' => array('className' => 'ContentEnglish',
                                                                          
'foreignKey' => 'content',
                                                                          
'conditions' => '',
                                                                          
'fields' => 'content',
                                                                          
'order' => '',
                                                                          
'counterCache' => ''),
        );

I am not sure about this way and i am yet to see what i have to do to  
get it to save. I will look into the bind, unbind functions.

thanks



On 3 May 2007, at 15:50, [EMAIL PROTECTED] wrote:

>
> You are asking is how to set up relationships. If you don't know how
> to create basic relationships, then you need to read cake manual, and
> then go through the blog tutorial. You can do both in about 3-4 hours.
> After that, try setting up your relationships; If you still have
> trouble at that point, come back here and ask for help.
>
> There are plenty of people willing to help here, but you need to know
> the basics first.
>
> On a different note: I think you would find it easier to keep all of
> you content in one table, rather than having one table for each
> language. Just add a field to identify the language.
>
> page.id
> page.name
> page.language
> page.header
> page.body
>
> Now when some one goes to the "home" page, you can simply query
> page.name=home AND page.language = users_language
>
> This way you don't need to bind and unbind models, and you don't need
> to create a new table every time you add a new language.
>
> good luck,
> cook
>
>
>
>
> On May 3, 9:14 am, Anton Morrison <[EMAIL PROTECTED]> wrote:
>> Hi
>>
>> I have a table with a page title and body. the title and body are
>> integers that link to a table with there content value (so i can have
>> different tables for different languages). Is there a relationship i
>> can set up to get the content values in one query?
>>
>> at the moment i get the integer values then go through the content
>> table and get the text values, but this means extra trips to the
>> database.
>>
>> thanks in advance.
>>
>> Anton Morrison
>> [EMAIL PROTECTED]
>
>
> >

Anton Morrison
[EMAIL PROTECTED]




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