bug #37056 [DoctrineBridge] register event listeners depending on the installed packages (xabbuh)
This PR was merged into the 5.1 branch.
Discussion
----------
[DoctrineBridge] register event listeners depending on the installed packages
| Q | A
| ------------- | ---
| Branch? | 5.1
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix #37045
| License | MIT
| Doc PR |
Commits
-------
f61b0097f4
register event listeners depending on the installed packages
This commit is contained in:
commit
706ff581fb
@ -89,9 +89,16 @@ final class MessengerTransportDoctrineSchemaSubscriber implements EventSubscribe
|
||||
|
||||
public function getSubscribedEvents(): array
|
||||
{
|
||||
return [
|
||||
ToolEvents::postGenerateSchema,
|
||||
Events::onSchemaCreateTable,
|
||||
];
|
||||
$subscribedEvents = [];
|
||||
|
||||
if (class_exists(ToolEvents::class)) {
|
||||
$subscribedEvents[] = ToolEvents::postGenerateSchema;
|
||||
}
|
||||
|
||||
if (class_exists(Events::class)) {
|
||||
$subscribedEvents[] = Events::onSchemaCreateTable;
|
||||
}
|
||||
|
||||
return $subscribedEvents;
|
||||
}
|
||||
}
|
||||
|
@ -43,6 +43,10 @@ final class PdoCacheAdapterDoctrineSchemaSubscriber implements EventSubscriber
|
||||
|
||||
public function getSubscribedEvents(): array
|
||||
{
|
||||
if (!class_exists(ToolEvents::class)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return [
|
||||
ToolEvents::postGenerateSchema,
|
||||
];
|
||||
|
Reference in New Issue
Block a user