diff --git a/application/Espo/ORM/DB/Mapper.php b/application/Espo/ORM/DB/Mapper.php index cf7a5b01e6..d8c13be2cd 100644 --- a/application/Espo/ORM/DB/Mapper.php +++ b/application/Espo/ORM/DB/Mapper.php @@ -212,8 +212,8 @@ abstract class Mapper implements IMapper $params['whereClause'][$foreignKey] = $entity->get($key); if ($relType == IEntity::HAS_CHILDREN) { - $foreignTypeKey = $keySet['foreignTypeKey']; - $params['whereClause'][$foreignTypeKey] = $entity->getEntityType(); + $foreignType = $keySet['foreignType']; + $params['whereClause'][$foreignType] = $entity->getEntityType(); } if ($relType == IEntity::HAS_ONE) { diff --git a/application/Espo/ORM/DB/Query/Base.php b/application/Espo/ORM/DB/Query/Base.php index 7f923939f0..ea81854066 100644 --- a/application/Espo/ORM/DB/Query/Base.php +++ b/application/Espo/ORM/DB/Query/Base.php @@ -978,14 +978,14 @@ abstract class Base if (isset($relOpt['foreignKey'])) { $foreignKey = $relOpt['foreignKey']; } - $foreignTypeKey = 'parentType'; + $foreignType = 'parentType'; if (isset($relOpt['foreignType'])) { - $foreignTypeKey = $relOpt['foreignType']; + $foreignType = $relOpt['foreignType']; } return array( 'key' => $key, 'foreignKey' => $foreignKey, - 'foreignTypeKey' => $foreignTypeKey, + 'foreignType' => $foreignType, ); case IEntity::MANY_MANY: