Skip to content

Commit c258213

Browse files
committed
Allow class inheritance for mapping logic
1 parent fb412ca commit c258213

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/Mapping/Driver/ReflectionDriver.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ protected function load(
4040
$this->fillDefaultValue($property, $metadata);
4141
}
4242

43+
$this->loadParametersFor($class, $reflection);
44+
}
45+
46+
private function loadParametersFor(ClassMetadata $class, \ReflectionClass $reflection): void
47+
{
4348
$constructor = $reflection->getConstructor();
4449

4550
if ($constructor === null) {
@@ -57,6 +62,12 @@ protected function load(
5762
$metadata->setDefaultValue($parameter->getDefaultValue());
5863
}
5964
}
65+
66+
$parent = $reflection->getParentClass();
67+
68+
if ($parent instanceof \ReflectionClass) {
69+
$this->loadParametersFor($class, $parent);
70+
}
6071
}
6172

6273
private function fillDefaultValue(\ReflectionProperty $property, PropertyMetadata $meta): void

0 commit comments

Comments
 (0)