我有一个ORM \实体与列日期类型。当我使用的EntityManager选择对象更新我有这些错误:“开捕致命错误:类的DateTime的对象不能转换为字符串”Symfony 3:Doctrine dateTime问题行
柱:
/**
* @ORM\Id
* @ORM\Column(name="date", type="date")
*/
private $date;
和查询:
$query = $em->createQuery('SELECT t FROM AppBundle:Table t WHERE t.id = :t_id')->setParameter('t_id', $tId);
$result = $query->getResult(); // <- ¡ERROR IS HERE!
错误:
Catchable Fatal Error: Object of class DateTime could not be converted to string
非常感谢!