public function resolveModelClassName($model)
    {
        foreach ($this->metadataFactory->getAllMetadata() as $metadata) {
            /** @var Mapping\ClassMetadata $metadata */
            foreach ($metadata->getFieldMappings() as $mapping) {
                if (is_a($model, $mapping->getName())) {
                    return $metadata->getName();
                }
            }
        }

        return null;
    }
public function resolveModelClassName($model)
    {
        foreach ($this->metadataFactory->getAllMetadata() as $metadata) {
            /** @var Mapping\ClassMetadata $metadata */
            foreach ($metadata->getFieldMappings() as $mapping) {
                if (is_a($model, $mapping->getName())) {
                    return $metadata->getName();
                }
            }
        }

        return null;
    }
public function resolveModelClassName ( $ model ) { foreach ( $ this -> metadataFactory -> getAllMetadata ( ) as $ metadata ) { /** @var Mapping\ClassMetadata $metadata */ foreach ( $ metadata -> getFieldMappings ( ) as $ mapping ) { if ( is_a ( $ model , $ mapping -> getName ( ) ) ) { return $ metadata -> getName ( ) ; } } } return null ; }
Resolve model class name by sub model.

@param mixed $model

@return null|string

TODO: adding cache resolve
Resolve model class name by sub model .