{"action":"created","issue":{"url":"https://api.github.com/repos/propelorm/Propel2/issues/784","labels_url":"https://api.github.com/repos/propelorm/Propel2/issues/784/labels{/name}","comments_url":"https://api.github.com/repos/propelorm/Propel2/issues/784/comments","events_url":"https://api.github.com/repos/propelorm/Propel2/issues/784/events","html_url":"https://github.com/propelorm/Propel2/issues/784","id":46083821,"number":784,"title":"toJSON => fromJSON doesn't works","user":{"login":"daniele-webmaori","id":3600817,"avatar_url":"https://avatars.githubusercontent.com/u/3600817?v=3","gravatar_id":"","url":"https://api.github.com/users/daniele-webmaori","html_url":"https://github.com/daniele-webmaori","followers_url":"https://api.github.com/users/daniele-webmaori/followers","following_url":"https://api.github.com/users/daniele-webmaori/following{/other_user}","gists_url":"https://api.github.com/users/daniele-webmaori/gists{/gist_id}","starred_url":"https://api.github.com/users/daniele-webmaori/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daniele-webmaori/subscriptions","organizations_url":"https://api.github.com/users/daniele-webmaori/orgs","repos_url":"https://api.github.com/users/daniele-webmaori/repos","events_url":"https://api.github.com/users/daniele-webmaori/events{/privacy}","received_events_url":"https://api.github.com/users/daniele-webmaori/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":25,"created_at":"2014-10-17T10:09:57Z","updated_at":"2015-01-04T13:53:38Z","closed_at":"2015-01-01T20:16:01Z","body":"```php\r\n/*\r\n * EXPORT\r\n */\r\n\r\n$export = $form->toJSON();\r\n// {\"Id\":16,\"Name\":\"asd\",\"AdminFrom\":\"asd\",\"AdminSubject\":\"asd\",\"AdminTo\":\"asd\",\"CreatedBy\":1,\"CreatedAt\":{\"date\":\"2014-10-01 15:32:26\",\"timezone_type\":3,\"timezone\":\"Europe\\/Rome\"},\"ModifiedBy\":1,\"ModifiedAt\":{\"date\":\"2014-10-16 16:35:41\",\"timezone_type\":3,\"timezone\":\"Europe\\/Rome\"},\"Overwrote\":false}\r\n\r\n/*\r\n * IMPORT\r\n */\r\n\r\n$form->fromJSON($export);\r\n\r\n// Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct() expects parameter 1 to be string, array given' in /var/www/repo/kmaori/k-components/composer/propel/propel/src/Propel/Runtime/Util/PropelDateTime.php:90 Stack trace: #0 /var/www/repo/kmaori/k-components/composer/propel/propel/src/Propel/Runtime/Util/PropelDateTime.php(90): DateTime->__construct(Array) #1 /var/www/repo/kmaori/k-includes/models/Base/Form.php(666): Propel\\Runtime\\Util\\PropelDateTime::newInstance(Array, NULL, 'DateTime') #2 /var/www/repo/kmaori/k-includes/models/Base/Form.php(1412): Base\\Form->setCreatedAt(Array) #3 /var/www/repo/kmaori/k-includes/models/Base/Form.php(1444): Base\\Form->fromArray(Array, 'phpName') #4 /var/www/repo/kmaori/k-includes/models/Base/Form.php(2459): Base\\Form->importFrom('JSON', '{\"Id\":16,\"Name\"...') #5 /var/www/repo/kmaori/k-plugins/form/lib/FormQuery.php(21): Base\\Form->__call('fromJSON', Array) #6 /var/www/repo/kmaori/k-plugins/form/lib/FormQuery.php(21): Form->fromJSON('{\"Id\":16,\"Name\"...') #7 /var/ in /var/www/repo/kmaori/k-components/composer/twig/twig/lib/Twig/Template.php on line 294\r\n\r\n\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/propelorm/Propel2/issues/comments/68633587","html_url":"https://github.com/propelorm/Propel2/issues/784#issuecomment-68633587","issue_url":"https://api.github.com/repos/propelorm/Propel2/issues/784","id":68633587,"user":{"login":"andrenarchy","id":1874116,"avatar_url":"https://avatars.githubusercontent.com/u/1874116?v=3","gravatar_id":"","url":"https://api.github.com/users/andrenarchy","html_url":"https://github.com/andrenarchy","followers_url":"https://api.github.com/users/andrenarchy/followers","following_url":"https://api.github.com/users/andrenarchy/following{/other_user}","gists_url":"https://api.github.com/users/andrenarchy/gists{/gist_id}","starred_url":"https://api.github.com/users/andrenarchy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrenarchy/subscriptions","organizations_url":"https://api.github.com/users/andrenarchy/orgs","repos_url":"https://api.github.com/users/andrenarchy/repos","events_url":"https://api.github.com/users/andrenarchy/events{/privacy}","received_events_url":"https://api.github.com/users/andrenarchy/received_events","type":"User","site_admin":false},"created_at":"2015-01-04T13:53:38Z","updated_at":"2015-01-04T13:53:38Z","body":"As a non-expert with propel, I like the idea that `toArray()` converts all objects to primitives.\r\n\r\nJust reading @marcj's comment, it seems that `toArray()` has to be adapted analogously to `toJSON()`."}}