public function createCollectionManyHasMany(IMapper $mapperTwo, PropertyMetadata $metadata, IEntity $parent) { $targetMapper = $metadata->relationship->isMain ? $mapperTwo : $this; $collection = $targetMapper->findAll(); $collection->setRelationshipMapping(new RelationshipMapperManyHasMany($metadata, $this), $parent); return $collection; }