Join types
Fluent API
Pass a query object as the join source along with an alias, then callon() to specify the join condition. You can provide the alias in two ways:
- As a second parameter:
->leftJoin($query, 'alias') - Via fluent
as():->leftJoin($query)->as('alias')
Multiple joins
You can chain multiple join calls:FQL syntax
alias.field notation.
Subquery JOINs
You can use a fullSELECT statement as a join source by wrapping it in parentheses. The subquery is parsed recursively and must be aliased:
Joining across file formats
The join sources can use any format that FiQueLa supports. The left and right sources do not need to use the same format:ON condition
Theon() method (fluent) and the ON clause (FQL) accept the same condition syntax as where(). The left-hand field refers to the left source; the right-hand value refers to the joined source.
When both sources are aliased, you can use aliased dot-notation paths in ON conditions for clarity:
Calling
on() multiple times overwrites the previous condition. Define all join criteria in a single on() call, or use condition chaining through and()/or() after the on() call.