title: How can i get entityManager inside Subscriber in Symfony
body: <p>I use Api Platform. I have subscriber</p>
  
  <pre><code>namespace App\EventSubscriber\Api;
  
  use ApiPlatform\Core\EventListener\EventPriorities;
  use App\Entity\Product;
  use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  use Symfony\Component\HttpFoundation\Request;
  use Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent;
  use Symfony\Component\HttpKernel\KernelEvents;
  
  final class ProductCreateSubscriber implements EventSubscriberInterface
  {
      public static function getSubscribedEvents()
      {
          return [
              KernelEvents::VIEW =&gt; ['createHost', EventPriorities::POST_WRITE],
          ];
      }
  
      public function createHost(GetResponseForControllerResultEvent $event)
      {
          $product = $event-&gt;getControllerResult();
          $method = $event-&gt;getRequest()-&gt;getMethod();
  
          if (!$product instanceof Product || Request::METHOD_POST !== $method) {
              return;
          }
  
          I NEED ENTITY MANAGER HERE
      }
  }
  </code></pre>
  
  <p>Is it possible to get a entity manager here? </p>
  
  <p>I need create another entity, after creating Product</p>