Skip to content

Commit

Permalink
fix entity manager
Browse files Browse the repository at this point in the history
  • Loading branch information
yurikuzn committed Jun 19, 2023
1 parent 04906c5 commit 1ad2656
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions application/Espo/Tools/EntityManager/EntityManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -1688,12 +1688,19 @@ private function getAdditionalParamLocationMap(string $entityType): array
{
$templateType = $this->metadata->get(['scopes', $entityType, 'type']);

/** @var array<string, array<string, mixed>> $params */
$params = [
...($this->metadata->get(['app', 'entityManagerParams', 'Global']) ?? []),
...($this->metadata->get(['app', 'entityManagerParams', '@' . ($templateType ?? '_')]) ?? []),
...($this->metadata->get(['app', 'entityManagerParams', $entityType]) ?? []),
];
$map1 = $this->metadata->get(['app', 'entityManagerParams', 'Global']) ?? [];
$map2 = $this->metadata->get(['app', 'entityManagerParams', '@' . ($templateType ?? '_')]) ?? [];
$map3 = $this->metadata->get(['app', 'entityManagerParams', $entityType]) ?? [];

if (version_compare(PHP_VERSION, '8.1.0') < 0) {
// @todo Remove.
/** @var array<string, array<string, mixed>> $params */
$params = array_merge($map1, $map2, $map3);
}
else {
/** @var array<string, array<string, mixed>> $params */
$params = [...$map1, ...$map2, ...$map3];
}

$result = [];

Expand Down

0 comments on commit 1ad2656

Please sign in to comment.