Skip to content

Commit e551877

Browse files
committed
Inheritance: Correct constructor on different pk column name
1 parent 57523c1 commit e551877

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/Utils/BeanDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ public function getBeanPropertyDescriptors(): array
201201
public function getConstructorProperties(): array
202202
{
203203
$constructorProperties = array_filter($this->beanPropertyDescriptors, function (AbstractBeanPropertyDescriptor $property) {
204-
return $property->isCompulsory();
204+
return !$property instanceof ScalarReferencePropertyDescriptor && $property->isCompulsory();
205205
});
206206

207207
return $constructorProperties;

src/Utils/ScalarReferencePropertyDescriptor.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ public function __construct(
2121
NamingStrategyInterface $namingStrategy,
2222
AnnotationParser $annotationParser,
2323
AbstractBeanPropertyDescriptor $referencedPropertyDescriptor
24-
)
25-
{
24+
) {
2625
parent::__construct($table, $column, $namingStrategy, $annotationParser);
2726
$this->referencedPropertyDescriptor = $referencedPropertyDescriptor;
2827
}

0 commit comments

Comments
 (0)