src/Leevel/Database/Ddd/Relation/BelongsTo.php
public function matchPreLoad(array $entitys, Collection $result, string $relation): array
    {
        $maps = $this->buildMap($result);

        foreach ($entitys as $value) {
            $key = $value->__get($this->sourceKey);

            if (isset($maps[$key])) {
                $value->withRelationProp($relation, $maps[$key]);
            }
        }

        return $entitys;
    }
public function matchPreLoad(array $entitys, Collection $result, string $relation): array
    {
        $maps = $this->buildMap($result);

        foreach ($entitys as $value) {
            $key = $value->__get($this->sourceKey);

            if (isset($maps[$key])) {
                $value->withRelationProp($relation, $maps[$key]);
            }
        }

        return $entitys;
    }
匹配关联查询数据到模型实体.

@param \Leevel\Database\Ddd\IEntity[] $entitys
@param \Leevel\Collection\Collection  $result
@param string                         $relation

@return array