I am using date as a Data-Type in DOCTRINE , but its giving me this error:
Fatal error: Call to a member function format() on a non-object in C:\xampp\htdocs\test\doctrine\vendor\doctrine\dbal\lib\Doctrine\DBAL\Types\DateType.php on line 53
Here is my code:
/**
* private Date datePosted
* @Column(type="date")
* @Assert\NotEmpty
*/
private $datePosted ;
When i change type to string ,than it works fine. How can i fix this?