title: symfony form one-to-one relation DELETE
body: <p>This has to be something really simple, but i just can't figure it out.</p>
  
  <p>I got a Parent entity with a Child one-to-one unidirectional relation, the Parent entity being the owning side:</p>
  
  <pre><code>/**
   * @ORM\OneToOne(targetEntity="Child", cascade={"persist", "remove"}, orphanRemoval=true)
   * @ORM\JoinColumn(name="child_id", referencedColumnName="id")}
   */
  protected $Child;
  </code></pre>
  
  <p>The form has the ChildType added without it being required, but the ChildType has some required fields:</p>
  
  <pre><code>$builder-&gt;add('child', new ChildType(), [
      'required' =&gt; false,
  ]);
  </code></pre>
  
  <p>In a <strong>create</strong> action there are no problems:</p>
  
  <ul>
  <li><p>With all the Child fields being empty, the association stays null, the validation constraints for the Child relation are ignored, and the Child relation doesnt get created even though it has some required fields.</p></li>
  <li><p>When some of the Child fields are filled in, the association is created and the Child entity gets persisted if validation passes.</p></li>
  </ul>
  
  <p>So far working as expected..</p>
  
  <p>When <strong>updating</strong> the data set, everything goes well exactly the same way as when creating. Perfect</p>
  
  <p>Now a situation where i want the child entity removed, this should be as simple as clearing all child fields, since the child is not required. 
  Emtying all fields however, still triggers validation and results in doctrine updating the relation with all NULL fields.</p>
  
  <p><strong>What i tried:</strong></p>
  
  <p>Created a preUpdate listener for Doctrine to delete the relation if all fields are null. The problem is that you can't get this far without disabling validation. So this can't be the right way.
  One way would be to just use a callback constraints that returns true if all fields are null, but this would render all the property constraints useless for all one-to-one cases. Cant be true..</p>
  
  <p>So far no clue what now, nothing in the documentation either, only mass use-cases of x-to-many...</p>
  
  <p>Is it possible to somehow use a different validation group or no validation PostSubmit inside the symfony form or some other way to not use any validation if all fields are NULL of the child entity?</p>