I want to get Data in my form but it's return null for the select box who contains a forgein key of my entities and for my datetime, I have an error
Fatal Error: Call to a member function format() on null
I tried to getdata like this
$client = $form['id']['client']->getData();
this is a forgein key for my entity class and it in a select box, it's return null when I select option in select box, the name of select box is name = "appbundle_fournir[id][client]"
$date = $form['date']->getData()->format('d-m-Y');
for my datetime, I do something like that but it return an error I mention on top.
How can I do it properly to get my Data, thanks in advance and sorry for my bad english.