$associations =
[];
foreach ($variables as $variable) { $fields = EntityDefinitionQueryHelper::
getFieldsOfAccessor($definition,
$variable, true
);
/** @var Field|null $lastField */
$lastField =
end($fields);
$runtime =
new Runtime();
if ($lastField &&
$lastField->
getFlag(Runtime::
class)) { $associations =
array_merge($associations,
$runtime->
getDepends());
} $associations[] = EntityDefinitionQueryHelper::
getAssociationPath($variable,
$definition);
} return array_filter(array_unique($associations));
}}