src/Mapping.php
public function getKeyFromModel(string $modelName): string
    {
        foreach ($this->classMetadataList as $classMetadata) {
            if ($modelName === $classMetadata->getModelName()) {
                return $classMetadata->getKey();
            }
        }

        throw new MappingException(
            'Model name ' . $modelName . ' not found in mapping'
        );
    }
public function getKeyFromModel(string $modelName): string
    {
        foreach ($this->classMetadataList as $classMetadata) {
            if ($modelName === $classMetadata->getModelName()) {
                return $classMetadata->getKey();
            }
        }

        throw new MappingException(
            'Model name ' . $modelName . ' not found in mapping'
        );
    }
@param string $modelName model name

@throws MappingException