I have a DateTime
field:
/**
* Date time posted
* @Column(type=\"datetime\")
*/
private $dtPosted;
which is set to a defau
I came across a similar problem, but with a time
field, and this question and @romanb 's answer helped.
I was getting the following error, much like the one in the question.
Call to a member function format() on a non-object in
... /vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/TimeType.php on line 50
The solution was similar, for fields of the time
datatype, Doctrine will accept an instance of PHP's DateInterval
$quizFixture1->setCompletionTime(\DateInterval::createFromDateString('743 seconds'));