title: Doctrine cascade={remove} not working when the entity is deleted through onDelete="CASCADE"
body: <p>I encountered a problem with cascading relationships between entities using Doctrine 2.</p>
  
  <p>I have a <code>Media</code> entity, related to a parent event:</p>
  
  <pre><code>class Media
  {
  
      /**
       * @ORM\OneToOne(targetEntity="Event", mappedBy="media")
       */
      private $event;
  
      public function getEvent()
      {
          return $this-&gt;event;
      }
  
      public function setEvent(Event $event)
      {
          $this-&gt;event = $event;
      }
  
  }
  </code></pre>
  
  <p>Each <code>Event</code> is related to the media (bidirectional) and also related to an <code>Import</code> entity. </p>
  
  <pre><code>class Event
  {
  
      /**
       * @ORM\JoinColumn(name="media", referencedColumnName="id", onDelete="SET NULL")
       * @ORM\OneToOne(targetEntity="Media", inversedBy="event", cascade={"persist", "remove"}, orphanRemoval=true)
       */
      private $media;
  
      public function getMedia()
      {
          return $this-&gt;media;
      }
  
      public function setMedia(Media $media = null)
      {
          $this-&gt;media = $media;
      }
  
  
      /**
       * @ORM\JoinColumn(name="import", referencedColumnName="id", nullable=true, onDelete="CASCADE")
       * @ORM\ManyToOne(targetEntity="Import")
       */
      private $import;
  
      public function getImport()
      {
          return $this-&gt;import;
      }
  
      public function setImport(Import $import = null)
      {
          $this-&gt;import = $import;
      }
  
  }
  </code></pre>
  
  <hr>
  
  <p>The expected behavior is the following:</p>
  
  <ul>
  <li>The <code>Event</code> entity is automatically deleted when it's parent <code>Import</code> is deleted (ManyToOne relation with <code>onDelete="CASCADE"</code>).</li>
  <li>The <code>Event</code> entity also contains a reference (OneToOne relation) to a <code>Media</code> entity, that must be deleted when the Event is deleted.</li>
  </ul>
  
  <p>Both are working well:</p>
  
  <ul>
  <li>If I delete an Import, all related Events are deleted.</li>
  <li>If I delete an Event, the related Media is deleted.</li>
  </ul>
  
  <p>However, <strong>if I delete an Import, although events are deleted, Medias related to deleted events are not</strong>.</p>
  
  <p>Any ideas on what could be happening? Thanks!</p>