protected function getObjectManager(ClassMetadata $metadata): ?ObjectManager
    {
        foreach ($this->managerRegistryCollection as $managerRegistry) {
            if ($objectManager = $managerRegistry->getManagerForClass($metadata->getName())) {
                return $objectManager;
            }
        }

        return null;
    }
protected function getObjectManager(ClassMetadata $metadata): ?ObjectManager
    {
        foreach ($this->managerRegistryCollection as $managerRegistry) {
            if ($objectManager = $managerRegistry->getManagerForClass($metadata->getName())) {
                return $objectManager;
            }
        }

        return null;
    }
protected function getObjectManager ( ClassMetadata $ metadata ) : ? ObjectManager { foreach ( $ this -> managerRegistryCollection as $ managerRegistry ) { if ( $ objectManager = $ managerRegistry -> getManagerForClass ( $ metadata -> getName ( ) ) ) { return $ objectManager ; } } return null ; }
Get the object manager handling the specified class
Returns NULL if cannot be found.

@param ClassMetadata $metadata

@return null|ObjectManager
Get the object manager handling the specified class Returns NULL if cannot be found .