title: catch integrity constraint error in symfony and doctrine
body: <p>I have two tables which are: 
  Category:</p>
  
  <pre><code>|id | cat_name  |
  | 1 | nameone   |
  | 2 | nametwo   |   
  | 3 | namethree |
  </code></pre>
  
  <p>News:</p>
  
  <pre><code>| id | id_cat | title    |
  | 1  | 1      | title1 |
  | 2  | 2      | title2 |
  | 3  | 3      | title3 |
  | 4  | 3      | title4 |
  | 5  | 3      | title5 |
  </code></pre>
  
  <p>i use <strong>doctrine:generate-module backend category Category</strong> and i have a list Category with <strong>executeEdit</strong>, Update etc. If i delete Category id 3 - namethree then I get the following error </p>
  
  <blockquote>
    <p>SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or
    update a parent row: a foreign key constraint fails .</p>
  </blockquote>
  
  <p>How can I make sure that if I delete Category 3 then all News for Category 3 are moved to Category 2 for example without an error? How can catch this?</p>