I\'ve been trying to set up a form with Symfony 2.
So I followed the tutorial and I\'ve created a special class for creating the form and handling the
What you're trying to do here is creating a security hole: anyone would be able to inject any ID in the user_product_id field and dupe you application. Not mentioning that it's useless to render a field and to not show it.
You can set a default value to user_product_id in your entity:
/**
* @ORM\Annotations...
*/
private $user_product_id = 9000;