Skip to content

Commit

Permalink
Updated the listener to the new EventDispatcher implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
stof committed May 30, 2011
1 parent a04abda commit e594521
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions Form/EventListener/MergeCollectionListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -29,7 +29,7 @@ public function __construct(ModelManagerInterface $modelManager)

public static function getSubscribedEvents()
{
return Events::onBindNormData;
return array(FormEvents::ON_BIND_NORM_DATA => 'onBindNormData');
}

public function onBindNormData(FilterDataEvent $event)
Expand Down Expand Up @@ -58,4 +58,4 @@ public function onBindNormData(FilterDataEvent $event)

$event->setData($collection);
}
}
}
10 changes: 5 additions & 5 deletions Form/EventListener/ResizeFormListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -55,9 +55,9 @@ public function __construct(FormFactoryInterface $factory, $type, array $typeOpt
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',
);
}

Expand Down Expand Up @@ -156,4 +156,4 @@ public function onBindNormData(FilterDataEvent $event)

$event->setData($data);
}
}
}

0 comments on commit e594521

Please sign in to comment.