title: How bind POST data to object can save to Doctrine
body: <p>How bind POST data to object can save or edit to Doctrine.</p>
  
  <p>I use Doctrine with annotation entities. I don't figure out as bind array data to entities .</p>
  
  <p>I read about Symfony's components as standalone, too.</p>
  
  <p>Example : </p>
  
  <pre><code>$_POST # form data , array
  
  # this is how doctrine save object
  $product = new Product();
  $product-&gt;setName('product1');
  $entityManager-&gt;persist($product);
  $entityManager-&gt;flush();
  </code></pre>
  
  <p>I want  <code>$product = $helper-&gt;convert($_POST, ...) # return product object</code>
  then i can persist $product to $entityManager.</p>