-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Implement forward compatibility with Persistence 3 #9528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement forward compatibility with Persistence 3 #9528
Conversation
ea162c8
to
13dd68d
Compare
Locally I get
I don't understand why. |
b090fbe
to
6fa0a81
Compare
I have installed a debugger, and as it turns out, the ORM is executing a query with an id: orm/lib/Doctrine/ORM/Persisters/Entity/JoinedSubclassPersister.php Lines 150 to 157 in 193c3ab
However
The value for That seems to be caused by the value of |
Ok, so I think the same PR that made this impossible to bisect because it breaks signature compatibility also breaks the code of The current implementation creates a variable protected function getParentClasses(string $name)
{
// Collect parent classes, ignoring transient (not-mapped) classes.
$parentClasses = [];
$parentClasses = $this->getReflectionService()
->getParentClasses($name);
foreach (array_reverse($parentClasses) as $parentClass) {
if ($this->getDriver()->isTransient($parentClass)) {
continue;
}
$parentClasses[] = $parentClass;
}
return $parentClasses;
} |
Blocked by doctrine/persistence#239 and a merge up |
I think, persistence should not be coupled to Doctrine Annotations at all. And tbh, that class does not actually need to read annotations. That's what I tried to solve in doctrine/persistence#217. For now, you can get the attribute driver working again if you skip the call to the parant constructor. --- a/lib/Doctrine/ORM/Mapping/Driver/AttributeDriver.php (revision 08eaba44ca081311495b4c153a9fab383863a06e)
+++ b/lib/Doctrine/ORM/Mapping/Driver/AttributeDriver.php (date 1645482841532)
@@ -46,7 +46,8 @@
));
}
- parent::__construct(new AttributeReader(), $paths);
+ $this->reader = new AttributeReader();
+ $this->addPaths($paths);
}
/** |
ea58d2b
to
66a1c5c
Compare
4264442
to
7301dfe
Compare
7301dfe
to
dd5223f
Compare
6199e9f
to
8a21195
Compare
I think we should resolve doctrine/persistence#217 before doing more work on this. |
b2630f2
to
f597343
Compare
🤔 I don't reproduce the issue with https://phpstan.org/r/25a5c36c-067e-4306-9a8d-4433401d347a … let's try updating phpstan. UPD: that does not help. |
c5c2c63
to
df93d29
Compare
df93d29
to
ee179e2
Compare
Fixed it locally by copy pasting phpdoc from |
7cfc5c0
to
cdebbab
Compare
cdebbab
to
bbb7d97
Compare
bbb7d97
to
7c83373
Compare
This PR aims at getting more compatible with Persistence 3 / see how much work is needed.