title: Can Symfony2 form event listener access the service container and how?
body: <p>As per title, can a Symfony2 form event listener access the service container?</p>
  
  <p>This is an example event listener (for post bind event):</p>
  
  <pre><code>class CustomerTypeSubscriber implements EventSubscriberInterface
  {
  
      public static function getSubscribedEvents()
      {
          return array(FormEvents::POST_BIND =&gt; 'onPostBind');
      }
  
      public function onPostBind(DataEvent $event)
      {
          // Get the entity (Customer type)
          $data = $event-&gt;getData();
  
          // Get current user
          $user = null;    
  
          // Remove country if address is not provided
          if(!$data-&gt;getAddress()) :
              $data-&gt;setCountry(null);
          endif;
      }
  
  }
  </code></pre>