title: Using Doctrine extension softdeleteable with api-platform
body: <p>I'm building an API with Symfony 3.4 and api-platform. I want to use soft delete on my entity. I've installed <code>DoctrineExtensions</code> and <code>StofDoctrineExtensionsBundle</code>.</p>
  
  <p><code>config.yml</code>:</p>
  
  <pre><code>doctrine:
      dbal:
          connections:
              default:
                 […]
  
      orm:
          entity_managers:
              default:
                  naming_strategy: doctrine.orm.naming_strategy.underscore
                  connection: default
                  mappings:
                      […]
                  filters:
                      softdeleteable:
                          class: Gedmo\SoftDeleteable\Filter\SoftDeleteableFilter
                          enabled: true
  </code></pre>
  
  <p>And my entity :</p>
  
  <pre><code>&lt;?php
  
  namespace AppBundle\Entity;
  
  use ApiPlatform\Core\Annotation\ApiResource;
  use Doctrine\ORM\Mapping as ORM;
  use Gedmo\Mapping\Annotation as Gedmo;
  
  /**
   * MyEntity
   *
   * @ORM\Table(name="MyEntity", schema="MyEntity")
   * @ORM\Entity(repositoryClass="AppBundle\Repository\MyEntityRepository")
   * @Gedmo\SoftDeleteable(fieldName="deletedAt")
   * @ApiResource
   */
  class MyEntity
  {
      /**
       * @var \DateTime
       * @ORM\Column(name="deleted_at", type="datetime")
       */
      private $deletedAt;
  
      […]
  </code></pre>
  
  <p>This is not working. I'm aware that I need to configure something (namely the EventManager), but I don't know how.
  Here is the error I get when I try to create an entity </p>
  
  <p><code>Listener "SoftDeleteableListener" was not added to the EventManager!</code></p>
  
  <p>I think I've done everything that page explains : <a href="https://symfony.com/doc/master/bundles/StofDoctrineExtensionsBundle/index.html" rel="noreferrer">StofDoctrineExtensionsBundle documentation</a></p>
  
  <p>Any help would be greatly appreciated.</p>