I have a DateTime
field:
/**
* Date time posted
* @Column(type="datetime")
*/
private $dtPosted;
which is set to a default value by using a LifeCycleCallback
/**
* @PrePersist
*/
function onPrePersist() {
// set default date
$this->dtPosted = date( Y-m-d H:m:s );
I am getting the following error:
Fatal error: Call to a member function format() on a non-object in D:ResourceLibraryFrameworksDoctrinelibDoctrineDBALTypesDateTimeType.php on line 46