title: Symfony 4 api - how do I update an entity
body: <p>I have created a <code>Symfony 4</code> project which uses <code>jms_serializer</code> <code>annotations</code> and <code>fos_rest_bundle</code></p>
  
  <p>I am wondering how I would go about updating an existing entity.</p>
  
  <p>I have the following:</p>
  
  <pre><code>class ProgramController extends FOSRestController {
  
   /**
    * @FOSRest\Put("/programs/{id}")
    * @ParamConverter("updatedProgram", converter="fos_rest.request_body")
    */
    public function putProgram(Program $program, Program $updatedProgram) 
    {
       //missing logic here
    }
  }
  </code></pre>
  
  <p>Using <code>ParamConverters</code> I have 2 <code>Program Entity Objects</code><br>
  <code>$program</code> - which is populated from the database<br>
  <code>$updatedProgram</code> - which is populated from the submitted <code>json</code> data</p>
  
  <p><code>Program Entities</code> have multiple relations to other <code>Entities</code>.</p>
  
  <p>What is the best way to update the program?</p>
  
  <p>Do I simply overwrite <code>$program</code> with <code>$updatedProgram</code>? (This would assume that all of the existing <code>$program</code> data is part of <code>$updatedProgram</code> and not just the updates. </p>
  
  <p>Do I need to manually set all of the <code>$program-&gt;property</code> values to equal the <code>$updatedProgram</code> values?</p>
  
  <p>I have used the <code>FormType</code> in the past for a non-api symfony project.
  Would it make sense to use it here?</p>