473,325 Members | 2,712 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Doctrine2Fatal error: Call to a member function format() on a non-object

132 100+
I have the Fields the Type DATETIME and Other DATE but when i INSERT NULL I have This Error : on controller i set that :
Expand|Select|Wrap|Line Numbers
  1. $data ['dateCreation']        = $tab['dateCrea'];
Expand|Select|Wrap|Line Numbers
  1. $tab['dateCrea'] somtimes NULL other Times 123614 or 21/12/2014 21:05:00 or others time
in Entity I do That

Expand|Select|Wrap|Line Numbers
  1. public function setModificationdate($modificationdate)
  2.     {
  3.         $this->modificationdate = new \DateTime($modificationdate);
  4.  
  5.         return $this;
  6.     }
Fatal error: Call to a member function format() on a non-object in C:\wamp\www\imprimvert\vendor\doctrine\dbal\lib\Do ctrine\DBAL\Types\DateType.php on line 53
How can i resolve that
Apr 11 '16 #1
2 1640
Dormilich
8,658 Expert Mod 8TB
How can i resolve that
do not insert NULL values.

if the field allows NULL values, you have to somehow pass the NULL data type in doctrine as well (instead of the date/datetime data type).
Apr 12 '16 #2
manjava
132 100+
so i get the data dynamically sometimes date sometimes contains 2000 or others but always i get this error
Apr 12 '16 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

37
by: Ben | last post by:
Hi, there. Recently I was working on a problem where we want to save generic closures in a data structure (a vector). The closure should work for any data type and any method with pre-defined...
2
by: dmitry.freitor | last post by:
Why would someone call a non-static provate member function from another non-static member function of the same class via the this pointer? Thanks. DF
6
by: bluekite2000 | last post by:
I have Vector<complex<float> > V(5); V.rand(); Vector<float> V1(V); //specialized function here to return norm(V). This works fine Vector<double> V2(5); V2.rand(); Vector<float>...
1
by: bluekite2000 | last post by:
Here is the compilable code, along w/ the error #include<iostream> #include<complex> typedef std::complex<float> ComplexSingle; using namespace std; template<typename T> class X { private:...
8
by: nsharma78 | last post by:
Hi, I have a code as follows: class A { public: void print(){cout << "Magic" << endl;} };
9
by: java | last post by:
Hey there, I just removed an elderly PHP4-Installation from my Windows-Box and installed PHP 5.2.1. I used the PHP4-Module as local batchfile- interpreter by E:\ersDHCP>php ./extractLog.php ...
2
by: mahesh | last post by:
Can anyone direct me to the place where i find the solution for the error message "cannot call member function 'X' without object"??? thanks in advance
2
by: Elliott | last post by:
Hello Everyone, I have a function in a header (KeyDialog.h) as such: void setKey(Key&); The function implementation is as such (KeyDialog.cpp): void KeyDialog::setKey(Key& k1) {
2
by: church7 | last post by:
Hello, I wrote the following class: In this case, the error message was
10
by: randysimes | last post by:
I am trying to pass uid and pwd to the function CheckPW of the class PWServer. I receive the error pwclient.cpp:41: error: cannot call member function âint PWServer::CheckPW(const char*, char*)â...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.