Permalink
Browse files

set id generator to parent if parent is mapped

  • Loading branch information...
1 parent b110b09 commit 32229ab47f41c25eccb93eb0bff2bbf3e7a0d1a1 @uwej711 committed Mar 8, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/Doctrine/ODM/PHPCR/Mapping/ClassMetadata.php
@@ -459,7 +459,9 @@ public function mapId(array $mapping)
if (isset($mapping['id']) && $mapping['id'] === true) {
$mapping['type'] = 'string';
$this->setIdentifier($mapping['fieldName']);
- if (isset($mapping['strategy'])) {
+ if (null !== $this->parentMapping) {
+ $this->setIdGenerator(self::GENERATOR_TYPE_PARENT);
+ } else if (isset($mapping['strategy'])) {
$this->setIdGenerator($mapping['strategy']);
}
}

0 comments on commit 32229ab

Please sign in to comment.