8000 [DoctrineBridge] deprecate `MergeDoctrineCollectionListener::onBind()` · symfony/symfony@cfb2f6c · GitHub
[go: up one dir, main page]

Skip to content

Commit cfb2f6c

Browse files
committed
[DoctrineBridge] deprecate MergeDoctrineCollectionListener::onBind()
1 parent 6fb9fee commit cfb2f6c

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

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

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ public static function getSubscribedEvents()
3131
{
3232
// Higher priority than core MergeCollectionListener so that this one
3333
// is called before
34-
return array(FormEvents::SUBMIT => array('onBind', 10));
34+
return array(FormEvents::SUBMIT => array('onSubmit', 10));
3535
}
3636

37-
public function onBind(FormEvent $event)
37+
public function onSubmit(FormEvent $event)
3838
{
3939
$collection = $event->getForm()->getData();
4040
$data = $event->getData();
@@ -45,4 +45,17 @@ public function onBind(FormEvent $event)
4545
$collection->clear();
4646
}
4747
}
48+
49+
/**
50+
* Alias of {@link onSubmit()}.
51+
*
52+
* @deprecated since version 3.1, to be removed in 4.0.
53+
* Use {@link onSubmit()} instead.
54+
*/
55+
public function onBind(FormEvent $event)
56+
{
57+
@trigger_error('The '.__METHOD__.' method is deprecated since version 3.1 and will be removed in 4.0. Use the onSubmit() method instead.', E_USER_DEPRECATED);
58+
59+
$this->onSubmit($event);
60+
}
4861
}

0 commit comments

Comments
 (0)
0