My problem is that I want to set a value to one field of an Entity and this value comes from a form.
The form is bound to another entity and this field of the form is named fmedida.
This is what I've tried
$hijo-> setFinicio(new \DateTime($form->getData()->getfmedida()));
But of course the syntax is not correct since I have this error message:
"DateTime::__construct() expects parameter 1 to be string, object given"