{"action":"created","issue":{"url":"https://api.github.com/repos/nextras/orm/issues/156","repository_url":"https://api.github.com/repos/nextras/orm","labels_url":"https://api.github.com/repos/nextras/orm/issues/156/labels{/name}","comments_url":"https://api.github.com/repos/nextras/orm/issues/156/comments","events_url":"https://api.github.com/repos/nextras/orm/issues/156/events","html_url":"https://github.com/nextras/orm/issues/156","id":130718327,"number":156,"title":"Entity::toArray error at PostgreSQL","user":{"login":"f3l1x","id":538058,"avatar_url":"https://avatars.githubusercontent.com/u/538058?v=3","gravatar_id":"","url":"https://api.github.com/users/f3l1x","html_url":"https://github.com/f3l1x","followers_url":"https://api.github.com/users/f3l1x/followers","following_url":"https://api.github.com/users/f3l1x/following{/other_user}","gists_url":"https://api.github.com/users/f3l1x/gists{/gist_id}","starred_url":"https://api.github.com/users/f3l1x/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/f3l1x/subscriptions","organizations_url":"https://api.github.com/users/f3l1x/orgs","repos_url":"https://api.github.com/users/f3l1x/repos","events_url":"https://api.github.com/users/f3l1x/events{/privacy}","received_events_url":"https://api.github.com/users/f3l1x/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nextras/orm/labels/1-bug","name":"1-bug","color":"BD2C00"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-02-02T15:33:57Z","updated_at":"2016-02-14T15:28:15Z","closed_at":null,"body":"Version: v1.1.6, maybe also in 2.0\r\n\r\n```php\r\n$entity->toArray($entity::TO_ARRAY_RELATIONSHIP_AS_ID);\r\n```\r\n\r\nIt generates:\r\n\r\n```\r\nSELECT order.* FROM \"order\" AS \"order\" WHERE order.customer_id IN (1)\r\n```\r\n\r\nError: `ERROR: syntax error at or near \"order\"\r\nLINE 1: SELECT order.* FROM \"order\" AS \"order\" WHERE \"order\".\"custom...`\r\n\r\nBut it should be:\r\n\r\n```\r\nSELECT \"order\".* FROM \"order\" AS \"order\" WHERE \"order\".\"customer_id\" IN (1)\r\n```\r\n\r\n----\r\n\r\nAny idea?"},"comment":{"url":"https://api.github.com/repos/nextras/orm/issues/comments/183905445","html_url":"https://github.com/nextras/orm/issues/156#issuecomment-183905445","issue_url":"https://api.github.com/repos/nextras/orm/issues/156","id":183905445,"user":{"login":"f3l1x","id":538058,"avatar_url":"https://avatars.githubusercontent.com/u/538058?v=3","gravatar_id":"","url":"https://api.github.com/users/f3l1x","html_url":"https://github.com/f3l1x","followers_url":"https://api.github.com/users/f3l1x/followers","following_url":"https://api.github.com/users/f3l1x/following{/other_user}","gists_url":"https://api.github.com/users/f3l1x/gists{/gist_id}","starred_url":"https://api.github.com/users/f3l1x/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/f3l1x/subscriptions","organizations_url":"https://api.github.com/users/f3l1x/orgs","repos_url":"https://api.github.com/users/f3l1x/repos","events_url":"https://api.github.com/users/f3l1x/events{/privacy}","received_events_url":"https://api.github.com/users/f3l1x/received_events","type":"User","site_admin":false},"created_at":"2016-02-14T15:28:15Z","updated_at":"2016-02-14T15:28:15Z","body":"I have had 1.1.6 version, I'm sure. At 2.0 it's oukey. "}}