[commits] [Wiki] created: TurbaJoinTables

Jan Schneider jan at horde.org
Fri May 18 16:21:11 UTC 2018


jan  Fri, 18 May 2018 16:21:11 +0000

Created page: https://wiki.horde.org/TurbaJoinTables

+ How to use turba with multiple tables for a single address book

For this How-To to work, you need at least Turba 4.2.22.

There are two different ways to configure Turba, depending on how you  
want to join your tables. In both cases, you need to customize the  
backends configuration in a {{turba/config/backends.local.php}}. You  
need to edit both the {{'params'}} and {{'map'}} setting of your  
backend.

Either:

<code>
     'params' => array(
         .
         .
         .
         'table' => 'table1 t1, table2 t2',
         // The following will be added to there WHERE clause of the  
generated SQL query:
         'filter' => 't1.some_field = t2.another_field'
     ),
     'map' => array(
         .
         .
         .
         'firstname' => 't1.object_firstname',
</code>

Or:


<code>
     'params' => array(
         .
         .
         .
         'table' => 'table1 t1 LEFT JOIN table2 t2 ON t1.some_field =  
t2.another_field',
     ),
     'map' => array(
         .
         .
         .
         'firstname' => 't1.object_firstname',
</code>




More information about the commits mailing list