Skip to content

Commit 264b0d6

Browse files
committed
Allow versioning for inherited fields
1 parent 37d3503 commit 264b0d6

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

lib/Gedmo/Loggable/Mapping/Driver/Annotation.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,13 @@ public function readExtendedMetadata($meta, array &$config)
6060

6161
// property annotations
6262
foreach ($class->getProperties() as $property) {
63-
if ($meta->isMappedSuperclass && !$property->isPrivate() ||
64-
$meta->isInheritedField($property->name) ||
65-
isset($meta->associationMappings[$property->name]['inherited'])
66-
) {
63+
$field = $property->getName();
64+
if ($meta->isMappedSuperclass && !$property->isPrivate()) {
6765
continue;
6866
}
6967

7068
// versioned property
7169
if ($this->reader->getPropertyAnnotation($property, self::VERSIONED)) {
72-
$field = $property->getName();
7370
if (!$this->isMappingValid($meta, $field)) {
7471
throw new InvalidMappingException("Cannot versioned [{$field}] as it is collection in object - {$meta->name}");
7572
}
@@ -78,7 +75,9 @@ public function readExtendedMetadata($meta, array &$config)
7875
continue;
7976
}
8077
// fields cannot be overrided and throws mapping exception
81-
$config['versioned'][] = $field;
78+
if (!(isset($config['versioned']) && in_array($field, $config['versioned']))) {
79+
$config['versioned'][] = $field;
80+
}
8281
}
8382
}
8483

0 commit comments

Comments
 (0)