diff --git a/application/Espo/Core/Utils/Database/Orm/Relations/BelongsToParent.php b/application/Espo/Core/Utils/Database/Orm/Relations/BelongsToParent.php index bb00adbedc..0b8689d450 100644 --- a/application/Espo/Core/Utils/Database/Orm/Relations/BelongsToParent.php +++ b/application/Espo/Core/Utils/Database/Orm/Relations/BelongsToParent.php @@ -35,33 +35,32 @@ class BelongsToParent extends Base { $linkParams = $this->getLinkParams(); - return array( - $entityName => array( - 'fields' => array( - $linkName.'Id' => array( + return [ + $entityName => [ + 'fields' => [ + $linkName.'Id' => [ 'type' => 'foreignId', 'index' => $linkName, - ), - $linkName.'Type' => array( + ], + $linkName.'Type' => [ 'type' => 'foreignType', 'notNull' => false, 'index' => $linkName, - 'len' => 100 - ), - $linkName.'Name' => array( + 'len' => 100, + ], + $linkName.'Name' => [ 'type' => 'varchar', 'notStorable' => true, - ), - ), - 'relations' => array( - $linkName => array( + ], + ], + 'relations' => [ + $linkName => [ 'type' => 'belongsToParent', - 'key' => $linkName.'Id', - ), - ), - ), - ); - + 'key' => $linkName .'Id', + 'foreign' => $linkParams['foreign'] ?? null, + ], + ], + ], + ]; } - -} \ No newline at end of file +}