Add support for custom ID generator in Yaml driver
This commit is contained in:
parent
0a4fbc9770
commit
84086915e4
@ -191,6 +191,12 @@ class YamlDriver extends AbstractFileDriver
|
||||
// Check for SequenceGenerator/TableGenerator definition
|
||||
if (isset($idElement['sequenceGenerator'])) {
|
||||
$metadata->setSequenceGeneratorDefinition($idElement['sequenceGenerator']);
|
||||
} else if (isset($idElement['customIdGenerator'])) {
|
||||
$customGenerator = $idElement['customIdGenerator'];
|
||||
$metadata->setCustomGeneratorDefinition(array(
|
||||
'class' => (string) $customGenerator['class'],
|
||||
'args' => $customGenerator['args']
|
||||
));
|
||||
} else if (isset($idElement['tableGenerator'])) {
|
||||
throw MappingException::tableIdGeneratorNotImplemented($className);
|
||||
}
|
||||
|
@ -3,4 +3,12 @@ Doctrine\Tests\ORM\Mapping\Animal:
|
||||
inheritanceType: SINGLE_TABLE
|
||||
discriminatorMap:
|
||||
cat: Cat
|
||||
dog: Dog
|
||||
dog: Dog
|
||||
id:
|
||||
id:
|
||||
type: integer
|
||||
generator:
|
||||
strategy: CUSTOM
|
||||
customIdGenerator:
|
||||
class: stdClass
|
||||
args: [ par1, par2 ]
|
Loading…
Reference in New Issue
Block a user