Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 88b6e79

Browse filesBrowse files
committed
[DoctrineBridge] added a bc layer for symfony#18069
1 parent 352997e commit 88b6e79
Copy full SHA for 88b6e79

File tree

Expand file treeCollapse file tree

1 file changed

+8
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-2
lines changed

‎src/Symfony/Bridge/Doctrine/Form/EventListener/MergeDoctrineCollectionListener.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/Form/EventListener/MergeDoctrineCollectionListener.php
+8-2Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class MergeDoctrineCollectionListener implements EventSubscriberInterface
2929
{
3030
// Keeps BC. To be removed in 4.0
3131
private $bc = true;
32+
private $bcLayer = false;
3233

3334
public static function getSubscribedEvents()
3435
{
@@ -45,11 +46,13 @@ public static function getSubscribedEvents()
4546

4647
public function onSubmit(FormEvent $event)
4748
{
48-
// If onBind() is overridden then logic has been executed
4949
if ($this->bc) {
5050
@trigger_error('The onBind() method is deprecated since version 3.1 and will be removed in 4.0. Use the onSubmit() method instead.', E_USER_DEPRECATED);
5151

52-
return;
52+
if (!$this->bcLayer) {
53+
// If onBind() is overridden then logic has been executed
54+
return;
55+
}
5356
}
5457

5558
$collection = $event->getForm()->getData();
@@ -72,6 +75,9 @@ public function onBind()
7275
{
7376
if (__CLASS__ === get_class($this)) {
7477
$this->bc = false;
78+
} else {
79+
// parent::onBind() has been called
80+
$this->bcLayer = true;
7581
}
7682
}
7783
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.