How bind POST data to object can save or edit to Doctrine.
I use Doctrine with annotation entities. I don’t figure out as bind array data to entities .
I read about Symfony’s components as standalone, too.
Example :
$_POST # form data , array
# this is how doctrine save object
$product = new Product();
$product->setName('product1');
$entityManager->persist($product);
$entityManager->flush();
I want $product = $helper->convert($_POST, ...) # return product object
then i can persist $product to $entityManager.
This will help you how to handle forms:
http://symfony.com/doc/current/book/forms.html
To put data on an Entitiy user the setters.
If you want to put a post on a entity you have to create a function like this:
This works for me =)
And if I find a case who doesn’t works I just add some code.