protected function createSubAggregates($entities, string $relation): array
    {
        $aggregates = [];

        foreach ($entities as $entity) {
            $aggregates[] = $this->createSubAggregate($entity, $relation);
        }

        return $aggregates;
    }
protected function createSubAggregates($entities, string $relation): array
    {
        $aggregates = [];

        foreach ($entities as $entity) {
            $aggregates[] = $this->createSubAggregate($entity, $relation);
        }

        return $aggregates;
    }
protected function createSubAggregates ( $ entities , string $ relation ) : array { $ aggregates = [ ] ; foreach ( $ entities as $ entity ) { $ aggregates [ ] = $ this -> createSubAggregate ( $ entity , $ relation ) ; } return $ aggregates ; }
Create a child, aggregated entity.

@param mixed  $entities
@param string $relation

@return array
Create a child aggregated entity .