When I'm trying validate $date with assert, like this : @Assert\Date()
/**
* @ORM\Column(type="date")
* @DatagridColumn(sortable=TRUE)
* @Assert\Date()
* @Assert\NotBlank()
*/
private $date;
But I have an error :
Error: Call to a member function format() on string
500 Internal Server Error - FatalErrorException
Does anyone know, why it's happening ?
From documentation: TYPE could be string.
I also checked the format using dump() and it's correct > YYYY-MM-DD
Without validation it works correct.
Thank you for any information