Hi,

While trying to build a copy of an existing application (which we
developed w/o a framework) using CakePHP, I've run into a small issue
regarding left outer joins in an HABTM relationship.

In our application, users can add/edit/delete packagings and
languages. Users can also store translations for each type of
packaging in each of the available languages. I want to present a
simple list of languages with an input box for each one to enter a
translation. To do this, I've created a languages_packagings table
which consists of four columns: id int, language_id int, packaging_id
int and translation varchar.

The Language and Packaging class point to each other using the
$hasAndBelongsToMany variable. Now, when I find() a specific
packaging, I'll also get related Language records which in turn each
contain the relevant LanguagePackaging record. The problem I'm having
is that newly added languages are not included. This is perfectly
logical behavior, but I'd like to be able to somehow specify that I
want a left outer join between the languages and languages_packagings
tables.

Is there a behavior that allows me to do just that ? I could of course
pull in the languages separately, but I'd love to be able to use $form-
>input ("Language.".$key.".LanguagesPackaging.translation") instead of
writing my own HTML. When I sabotage cake/libs/model/datasources/
dbo_source.php to perform outer joins, the rest of the code works
nicely, but this is of course not the right way to do this.

Hope I'm missing something obvious here, but thus far I haven't been
able to figure out a clean solution to this.

Kind regards,

Hans

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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