Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

set id generator to parent if parent is mapped

  • Loading branch information...
commit 32229ab47f41c25eccb93eb0bff2bbf3e7a0d1a1 1 parent b110b09
@uwej711 authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/Doctrine/ODM/PHPCR/Mapping/ClassMetadata.php
View
4 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']);
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.