Directus
#### :rotating_light: MIGRATED FROM REQUESTS.GETDIRECTUS.COM :rotating_light:

# With filter joins, allow the same table to be listed multiple times

### :+1: = 0


-----
### @stevepatter – (1 year ago)

Currently we can join tables while filtering data with:

    'joins' => [
                'candidate_application' => [
                    'on' => ['candidate_application.candidate', 'candidate_of_the_week.candidate']
                ]
            ]

but this restricts us to listing each table once. Instead, expand the join to an additional array layer & we can specify the same table multiple times (as would be possible in SQL).

    'joins' => [
        'candidate_application' => [
                [
            ‘on’ => [ 'candidate_application.candidate', 'candidates.id'],
            ‘type’ => ‘INNER’
                       ],
                [
            ‘on’ => [ 'candidate_application.candidate', 'jobs.id'],
            ‘type’ => ‘LEFT’
                       ]
    ],

Code changes would be processJoins in RelationalTableGateway