The following code:
has the following output:
mongo is: localhost:27018
db is: MyDatabase
error_reporting() returns: 22527
a book saved with id: 4de33f7409b35d4b38000002
Catchable fatal error: Method morph\property\Integer::__toString() must return a string value in phar:///var/www/morphtest/Morph.phar/Object.php on line 190
the line that throws it (in the pastebin code i provided ) is line 59. It seems you can print out the properties of the object once you get it out of the database, but if you try to print the object you get this.
Thanks for the letting me know. I have updated the code so that __toString will now work correctly for integer fields.
I think more classes have this problem. When i try to print out a class i got from the database with a date field, i get this:
[Tue May 31 00:59:04 2011] [error] [client 192.168.1.107] PHP Catchable fatal error: Method morph\property\Date::__toString() must return a string value in phar:///var/www/contacts/Morph.phar/Object.php on line 190
with the code: http://pastebin.com/APMwq2dT