src/Leevel/Database/Ddd/Relation/ManyMany.php
protected function buildMap(Collection $result): array
    {
        $maps = [];

        foreach ($result as $entity) {
            $maps[$entity->middle()->__get($this->middleSourceKey)][] = $entity;
        }

        return $maps;
    }
protected function buildMap(Collection $result): array
    {
        $maps = [];

        foreach ($result as $entity) {
            $maps[$entity->middle()->__get($this->middleSourceKey)][] = $entity;
        }

        return $maps;
    }
模型实体隐射数据.

@param \Leevel\Collection\Collection $result

@return array