Commit 4e1d17ec authored by Bernhard Schussek's avatar Bernhard Schussek

Merge branch 'join-functions' into 'master'

Added support for join functions

See merge request !13
parents 0a9c4034 821dd9d9
Pipeline #19413 passed with stage
in 1 minute and 44 seconds
......@@ -415,17 +415,22 @@ class QueryManipulator
$viaAlias = $alias;
}
$field = sprintf('%s.%s', $viaAlias, $joinMapping['field']);
$targetField = sprintf('%s.%s', $joinAlias, $joinMapping['targetField']);
if (isset($joinMapping['function'])) {
$field = sprintf($joinMapping['function'], $field);
}
if (isset($joinMapping['targetFunction'])) {
$targetField = sprintf($joinMapping['targetFunction'], $targetField);
}
$qb->leftJoin(
$joinMapping['targetEntity'],
$joinAlias,
Join::WITH,
sprintf(
'%s.%s = %s.%s',
$viaAlias,
$joinMapping['field'],
$joinAlias,
$joinMapping['targetField']
)
sprintf('%s = %s', $field, $targetField)
);
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment