{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230 {\fonttbl\f0\fmodern\fcharset0 Courier;} {\colortbl;\red255\green255\blue255;\red237\green245\blue255;\red245\green0\blue0;} \paperw11900\paperh16840\margl1440\margr1440\vieww10800\viewh8400\viewkind0 \deftab720 \pard\pardeftab720 \f0\fs26 \cf0 \cb2 [09:02] Do propel has the option to automatically join tables with their foreign key? I have some tables and would like to join them all with their foreign keys\ [09:05] <\cf3 Jarda\cf0 > tud: you can do FooQuery::create()->joinWith('Foo.Bar')->find()\ [09:06] didn't really get what you mean\ [09:06] Is "Bar" the foreign key in your example?\ [09:07] yeah\ [09:07] thanks\ [09:08] dorn here xD\ [09:08] the problem is we need 2 join a lot of tables dynamicly\ [09:08] is there a best pratice\ [09:09] for example we get via get params ColumnA,TableA and ColumnB,TableB -> now we need 2 join those 2 tables and select the 2 coulmns\ [09:09] this needs 2 be done dynamicly\ [09:09] hmm.. ok\ [09:09] any ideas?\ [09:09] well\ [09:10] you could in your FooQuery class write a public function joinByParameters(array $params) \{\'a0foreach ($params as $parm) \{ $this->joinWith(...); \} return $this; \}\ [09:10] or something like that\ [09:10] depends on the specific use case\ [09:12] so the best way is 2 use joinwith where u give the column u wanna join on?\ [09:12] yeah, or actually it's the foreign key name you give as parameter\ [09:13] and then you use ->joinWith('Foo.Bar');\ [09:13] what happens if u have done smith like this: tbl1->join with(tbl2.column) ->joinwith(tbl3.column)->join with(.... does that work?#\ [09:13] you can have multiple joins, yes\ [09:14] and he automatically detects how 2 join it? over multiple tables?\ [09:14] yes, it should work\ [09:16] for example if tbl1.A->tbl2.A and tbl1.B->tbl3.A but we join tbl1->join with(tbl2.A)->join with(tbl3.A) - this will work?\ [09:17] if the foreign keys are wrintten in the schema, it should work\ [09:17] try it out\ [09:18] k much thx if that works its really amazing work ;-) much thx 4 the help}