protected function getRelatedAggregatesFromHashes(array $hashes, string $relation): array
    {
        $related = [];

        foreach ($hashes as $hash) {
            $aggregate = $this->getRelatedAggregateFromHash($hash, $relation);

            if ($aggregate) {
                $related[] = $aggregate;
            }
        }

        return $related;
    }
protected function getRelatedAggregatesFromHashes(array $hashes, string $relation): array
    {
        $related = [];

        foreach ($hashes as $hash) {
            $aggregate = $this->getRelatedAggregateFromHash($hash, $relation);

            if ($aggregate) {
                $related[] = $aggregate;
            }
        }

        return $related;
    }
protected function getRelatedAggregatesFromHashes ( array $ hashes , string $ relation ) : array { $ related = [ ] ; foreach ( $ hashes as $ hash ) { $ aggregate = $ this -> getRelatedAggregateFromHash ( $ hash , $ relation ) ; if ( $ aggregate ) { $ related [ ] = $ aggregate ; } } return $ related ; }
Returns an array of related Aggregates from its entity hashes.

@param array  $hashes
@param string $relation

@return array
Returns an array of related Aggregates from its entity hashes .