6.0.0-git
2024-03-19
Last Modified 2018-05-18 by Jan Schneider

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:

    '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',

Or:

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