Browse Source

Replaced deprecated DataEvent and FilterDataEvent with generic FormEvent

Matthias Althaus 12 years ago
parent
commit
1c4f499e9e

+ 3 - 3
Form/EventListener/MergeCollectionListener.php

@@ -12,8 +12,8 @@
 
 namespace Sonata\AdminBundle\Form\EventListener;
 
+use Symfony\Component\Form\FormEvent;
 use Symfony\Component\Form\FormEvents;
-use Symfony\Component\Form\Event\FilterDataEvent;
 use Symfony\Component\EventDispatcher\EventSubscriberInterface;
 
 use Sonata\AdminBundle\Model\ModelManagerInterface;
@@ -41,9 +41,9 @@ class MergeCollectionListener implements EventSubscriberInterface
     }
 
     /**
-     * @param \Symfony\Component\Form\Event\FilterDataEvent $event
+     * @param \Symfony\Component\Form\FormEvent $event
      */
-    public function onBind(FilterDataEvent $event)
+    public function onBind(FormEvent $event)
     {
         $collection = $event->getForm()->getData();
         $data       = $event->getData();

+ 7 - 8
Form/EventListener/ResizeFormListener.php

@@ -11,9 +11,8 @@
 
 namespace Sonata\AdminBundle\Form\EventListener;
 
+use Symfony\Component\Form\FormEvent;
 use Symfony\Component\Form\FormEvents;
-use Symfony\Component\Form\Event\DataEvent;
-use Symfony\Component\Form\Event\FilterDataEvent;
 use Symfony\Component\Form\FormFactoryInterface;
 use Symfony\Component\Form\Exception\UnexpectedTypeException;
 use Symfony\Component\EventDispatcher\EventSubscriberInterface;
@@ -71,11 +70,11 @@ class ResizeFormListener implements EventSubscriberInterface
     }
 
     /**
-     * @param \Symfony\Component\Form\Event\DataEvent $event
+     * @param \Symfony\Component\Form\FormEvent $event
      *
      * @throws \Symfony\Component\Form\Exception\UnexpectedTypeException
      */
-    public function preSetData(DataEvent $event)
+    public function preSetData(FormEvent $event)
     {
         $form = $event->getForm();
         $data = $event->getData();
@@ -104,12 +103,12 @@ class ResizeFormListener implements EventSubscriberInterface
     }
 
     /**
-     * @param \Symfony\Component\Form\Event\DataEvent $event
+     * @param \Symfony\Component\Form\FormEvent $event
      *
      * @return mixed
      * @throws \Symfony\Component\Form\Exception\UnexpectedTypeException
      */
-    public function preBind(DataEvent $event)
+    public function preBind(FormEvent $event)
     {
         if (!$this->resizeOnBind) {
             return;
@@ -148,12 +147,12 @@ class ResizeFormListener implements EventSubscriberInterface
     }
 
     /**
-     * @param \Symfony\Component\Form\Event\FilterDataEvent $event
+     * @param \Symfony\Component\Form\FormEvent $event
      *
      * @return mixed
      * @throws \Symfony\Component\Form\Exception\UnexpectedTypeException
      */
-    public function onBind(FilterDataEvent $event)
+    public function onBind(FormEvent $event)
     {
         if (!$this->resizeOnBind) {
             return;