Преглед изворни кода

Updated the listener to the new EventDispatcher implementation

Christophe Coevoet пре 14 година
родитељ
комит
e594521cb8

+ 3 - 3
Form/EventListener/MergeCollectionListener.php

@@ -12,7 +12,7 @@
 
 namespace Sonata\AdminBundle\Form\EventListener;
 
-use Symfony\Component\Form\Events;
+use Symfony\Component\Form\FormEvents;
 use Symfony\Component\Form\Event\FilterDataEvent;
 use Symfony\Component\EventDispatcher\EventSubscriberInterface;
 
@@ -29,7 +29,7 @@ class MergeCollectionListener implements EventSubscriberInterface
 
     public static function getSubscribedEvents()
     {
-        return Events::onBindNormData;
+        return array(FormEvents::ON_BIND_NORM_DATA => 'onBindNormData');
     }
 
     public function onBindNormData(FilterDataEvent $event)
@@ -58,4 +58,4 @@ class MergeCollectionListener implements EventSubscriberInterface
 
         $event->setData($collection);
     }
-}
+}

+ 5 - 5
Form/EventListener/ResizeFormListener.php

@@ -11,7 +11,7 @@
 
 namespace Sonata\AdminBundle\Form\EventListener;
 
-use Symfony\Component\Form\Events;
+use Symfony\Component\Form\FormEvents;
 use Symfony\Component\Form\Event\DataEvent;
 use Symfony\Component\Form\Event\FilterDataEvent;
 use Symfony\Component\Form\FormFactoryInterface;
@@ -55,9 +55,9 @@ class ResizeFormListener implements EventSubscriberInterface
     public static function getSubscribedEvents()
     {
         return array(
-            Events::preSetData,
-            Events::preBind,
-            Events::onBindNormData,
+            FormEvents::PRE_SET_DATA => 'preSetData',
+            FormEvents::PRE_BIND => 'preBind',
+            FormEvents::ON_BIND_NORM_DATA => 'onBindNormData',
         );
     }
 
@@ -156,4 +156,4 @@ class ResizeFormListener implements EventSubscriberInterface
 
         $event->setData($data);
     }
-}
+}