2009/4/9 Jonathan Wage <jonw...@gmail.com>: > You cannot add the relationship to the I18n model from the yaml. You will > need to add the relationship with php code. The yaml schema builds the > opposite end of the relationship by finding the model in the yaml and adding > the relationship to it. In this case the I18n model doesn't exist in the > yaml, it is dynamically added at run-time. >
Thank you Jon for your answer. I'm too beginner in Symfony/Doctrine to add relation with php code. I don't know the good way to do that properly... May be I should learn a more Doctrine... Can you give me advises about this ? Fabien > - Jon > > On Thu, Apr 9, 2009 at 7:44 AM, FlyLM [ML] <flylm...@gmail.com> wrote: >> >> 2009/4/8 FlyLM [ML] <flylm...@gmail.com>: >> > 2009/4/8 FlyLM [ML] <flylm...@gmail.com>: >> >> Hello, >> >> >> >> I have started my first "real" project with Symfony and I've some >> >> problems and questions. >> >> >> >> 1) I use Doctrine as ORM and I18N Behavior in my "schema.yml" file to >> >> declare localized fields. >> >> >> >> "Localized" tables were generated with a columns named "lang". I would >> >> like to have a relation between this column "lang" and a table where I >> >> declared an a available list of languages. >> >> I didn't found how I can add a foreign key on the "localized" tables. >> >> How can I do it, is it possible ? >> >> >> >> For this first question, I've found a way, but it doesn't work (or I >> didn't understood something...). >> >> My "languages" table : >> >> ub_language: >> columns: >> id: { type: integer(2), primary: true } >> label: { type: string(64), notnull:true } >> iso: { type: string(2), notnull:true, unique:true } >> rfc: { type: string(5), notnull:true, unique:true } >> >> A table with I18N behavior : >> >> ub_currency: >> actAs: >> I18N: >> fields: [label] >> className: %CLASS%_i18n >> columns: >> id: { type: integer(1), primary:true } >> symbol: { type: string(32), notnull:true } >> label: { type: string(128), notnull:true } >> >> >> => I've follow this ticket : http://trac.doctrine-project.org/ticket/1029 >> >> So, I've : >> >> -------------------------------------------------------------------------------------------------------------- >> ub_language: >> columns: >> id: { type: integer(2), primary: true } >> label: { type: string(64), notnull:true } >> iso: { type: string(2), notnull:true, unique:true } >> rfc: { type: string(5), notnull:true, unique:true } >> relations: >> ub_currency_i18n: { local: iso, foreign: lang, type: one, foreignType: >> one } >> >> ub_currency: >> actAs: >> I18N: >> fields: [label] >> className: %CLASS%_i18n >> columns: >> id: { type: integer(1), primary:true } >> symbol: { type: string(32), notnull:true } >> label: { type: string(128), notnull:true } >> >> -------------------------------------------------------------------------------------------------------------- >> The generated SQL have not foreign key for columns 'lang'... >> Models don't show any relation between language and 'localized' table. >> >> Any idea ? >> >> >> Thanks for your help, >> >> Sorry for my english >> >> >> >> Fabien >> > > -- > Jonathan H. Wage > Open Source Software Developer & Evangelist > http://www.jwage.com > http://www.doctrine-project.org > http://www.symfony-project.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~----------~----~----~----~------~----~------~--~---