$source = EntityDefinitionQueryHelper::
escape($root) . '.' . EntityDefinitionQueryHelper::
escape($field->
getLocalField());
if ($field->
is(Inherited::
class) &&
$context->
considerInheritance()) { $source = EntityDefinitionQueryHelper::
escape($root) . '.' . EntityDefinitionQueryHelper::
escape($field->
getPropertyName());
} $parameters =
[ '#alias#' => EntityDefinitionQueryHelper::
escape($root . '.' .
$field->
getPropertyName() . '.mapping'
),
'#mapping_reference_column#' => EntityDefinitionQueryHelper::
escape($field->
getMappingReferenceColumn()),
'#mapping_table#' => EntityDefinitionQueryHelper::
escape($mapping->
getEntityName()),
'#mapping_local_column#' => EntityDefinitionQueryHelper::
escape($field->
getMappingLocalColumn()),
'#root#' => EntityDefinitionQueryHelper::
escape($root),
'#source#' =>
$source,
'#property#' => EntityDefinitionQueryHelper::
escape($root . '.' .
$field->
getPropertyName() . '.id_mapping'
),
];
$query->
addSelect( str_replace( array_keys($parameters),
array_values($parameters),
'(SELECT GROUP_CONCAT(HEX(#alias#.#mapping_reference_column#) SEPARATOR \'||\')
FROM #mapping_table# #alias#
WHERE #alias#.#mapping_local_column# = #source#'