Yo creo que mi verdadero problema esta en los valores fromDate y toDate de mi formulario, ya que en la entidad los tengo definidos como string. pero no se como convertir esos objetos date a string.
Adjunto parte de mi entidad:
Código PHP:
class SchoolRecord
{
/**
* @var integer
*
* @ORM\Column(name="id", type="integer", nullable=false)
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="school_name", type="string", length=150, nullable=false)
*/
private $schoolName;
/**
* @var string
*
* @ORM\Column(name="from_date", type="string", length=10, nullable=false)
*/
private $fromDate;
/**
* @var string
*
* @ORM\Column(name="to_date", type="string", length=10, nullable=false)
*/
private $toDate;
/**
* @var string
*
* @ORM\Column(name="head_name", type="string", length=160, nullable=false)
*/
private $headName;
/**
* @var string
*
* @ORM\Column(name="phone_number", type="string", length=15, nullable=true)
*/
private $phoneNumber;
/**
* @var string
*
* @ORM\Column(name="e_mail", type="string", length=80, nullable=true)
*/
private $eMail;
/**
* @var string
*
* @ORM\Column(name="is_current", type="string", length=255, nullable=false)
*/
private $isCurrent;
/**
* @var \DateTime
*
* @ORM\Column(name="created_date", type="datetime", nullable=false)
*/
private $createdDate;
/**
* @var \Addresses
*
* @ORM\ManyToOne(targetEntity="Addresses")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="address", referencedColumnName="id")
* })
*/
private $address;
/**
* @var \Applicant
*
* @ORM\ManyToOne(targetEntity="Applicant")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="applicant_id", referencedColumnName="id")
* })
*/
private $applicant;
}