title: Doctrine: Hijack a delete operation and make record invalid instead
body: <p>In order to avoid the <a href="https://www.wikiwand.com/en/Slowly_changing_dimension" rel="nofollow">Slowly Changing Dimension problem</a> (in short: I want to keep my order data even if a user gets deleted from the system), I thought about hijacking the <code>delete</code> event and instead setting an <code>invalid</code> flag on the record.</p>
  
  <ul>
  <li><p>I know of the <code>softdeletable</code> filter from StofDoctrineExtensionsBundle but I'm unsure if this will cascade to child objects.</p></li>
  <li><p>Is this a common/good practice/idea and do this with the following lifecycle callback?:</p></li>
  </ul>
  
  <p>/</p>
  
  <pre><code>/**
   * @ORM\PreRemove
   */
  
  public function makeInvalid() {
      $this-&gt;enddate = new \DateTime(); // set the end of validity property to now
      cascadeToRelatedObjects(); // i.e. make sure all 'child' objects also change validity
      somehowContinueTheOperation(); // i.e. do not cause an Error of sorts
  }
  </code></pre>
  
  <ul>
  <li>or should I, rather, change the functionality of the delete button on the form and assign an update function to it which does the above?</li>
  </ul>