original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: Resolve model class name by sub model.
  
  @param mixed $model
  
  @return null|string
  
  TODO: adding cache resolve
docstring_tokens: Resolve model class name by sub model .