private function completeIdGeneratorMapping(ClassMetadataInfo $class)
{
$idGenType = $class->generatorType;
if ($idGenType == ClassMetadata::GENERATOR_TYPE_AUTO) {
$class->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_NONE);
}
// Create & assign an appropriate ID generator instance
switch ($class->generatorType) {
case ClassMetadataInfo::GENERATOR_TYPE_INCREMENT:
throw new OXMException("Increment generator type not implemented yet");
break;
case ClassMetadataInfo::GENERATOR_TYPE_NONE:
$class->setIdGenerator(new \Doctrine\OXM\Id\AssignedGenerator());
break;
case ClassMetadataInfo::GENERATOR_TYPE_UUID:
$class->setIdGenerator(new \Doctrine\OXM\Id\UuidGenerator());
break;
default:
throw new OXMException("Unknown generator type: " . $class->generatorType);
}
}