{"action":"created","comment":{"url":"https://api.github.com/repos/doctrine/mongodb-odm/pulls/comments/47127797","id":47127797,"diff_hunk":"@@ -30,7 +30,7 @@ class StringType extends Type\n {\n     public function convertToDatabaseValue($value)\n     {\n-        return $value !== null ? (string) $value : null;\n+        return $value !== null ? $value instanceof \\MongoRegex ? $value : (string) $value : null;","path":"lib/Doctrine/ODM/MongoDB/Types/StringType.php","position":5,"original_position":5,"commit_id":"ae1cb255bdb2ab8c2d4b7a282165882e226394f5","original_commit_id":"ae1cb255bdb2ab8c2d4b7a282165882e226394f5","user":{"login":"malarzm","id":4947711,"avatar_url":"https://avatars.githubusercontent.com/u/4947711?v=3","gravatar_id":"","url":"https://api.github.com/users/malarzm","html_url":"https://github.com/malarzm","followers_url":"https://api.github.com/users/malarzm/followers","following_url":"https://api.github.com/users/malarzm/following{/other_user}","gists_url":"https://api.github.com/users/malarzm/gists{/gist_id}","starred_url":"https://api.github.com/users/malarzm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/malarzm/subscriptions","organizations_url":"https://api.github.com/users/malarzm/orgs","repos_url":"https://api.github.com/users/malarzm/repos","events_url":"https://api.github.com/users/malarzm/events{/privacy}","received_events_url":"https://api.github.com/users/malarzm/received_events","type":"User","site_admin":false},"body":"Can we put this new check in normal `if`? As much as I love ternary operator it'll more readable :)","created_at":"2015-12-09T18:07:14Z","updated_at":"2015-12-09T18:07:14Z","html_url":"https://github.com/doctrine/mongodb-odm/pull/1298#discussion_r47127797","pull_request_url":"https://api.github.com/repos/doctrine/mongodb-odm/pulls/1298","_links":{"self":{"href":"https://api.github.com/repos/doctrine/mongodb-odm/pulls/comments/47127797"},"html":{"href":"https://github.com/doctrine/mongodb-odm/pull/1298#discussion_r47127797"},"pull_request":{"href":"https://api.github.com/repos/doctrine/mongodb-odm/pulls/1298"}}},"pull_request":{"url":"https://api.github.com/repos/doctrine/mongodb-odm/pulls/1298","id":52839347,"html_url":"https://github.com/doctrine/mongodb-odm/pull/1298","diff_url":"https://github.com/doctrine/mongodb-odm/pull/1298.diff","patch_url":"https://github.com/doctrine/mongodb-odm/pull/1298.patch","issue_url":"https://api.github.com/repos/doctrine/mongodb-odm/issues/1298","number":1298,"state":"open","locked":false,"title":"Preserve \\MongoRegex on string typed identifier","user":{"login":"narcoticfresh","id":245441,"avatar_url":"https://avatars.githubusercontent.com/u/245441?v=3","gravatar_id":"","url":"https://api.github.com/users/narcoticfresh","html_url":"https://github.com/narcoticfresh","followers_url":"https://api.github.com/users/narcoticfresh/followers","following_url":"https://api.github.com/users/narcoticfresh/following{/other_user}","gists_url":"https://api.github.com/users/narcoticfresh/gists{/gist_id}","starred_url":"https://api.github.com/users/narcoticfresh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/narcoticfresh/subscriptions","organizations_url":"https://api.github.com/users/narcoticfresh/orgs","repos_url":"https://api.github.com/users/narcoticfresh/repos","events_url":"https://api.github.com/users/narcoticfresh/events{/privacy}","received_events_url":"https://api.github.com/users/narcoticfresh/received_events","type":"User","site_admin":false},"body":"This is a possible fix for #1294 and a unit test to avoid regression.\r\n\r\nI'm not sure if this should be handled in the `Type` class. It makes kinda sense as it's the culprit. But maybe it's a too much narrow check (topic wise) in the `Type`. But I'm not sure where it could be handled elsewhere as `convertToDatabaseValue()` will be called anyway and the `\\MongoRegex` instance would be lost(?)","created_at":"2015-12-07T12:36:21Z","updated_at":"2015-12-09T18:07:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"33c6ec04e55ea84af6e1ed995eef1e32f4782987","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/doctrine/mongodb-odm/pulls/1298/commits","review_comments_url":"https://api.github.com/repos/doctrine/mongodb-odm/pulls/1298/comments","review_comment_url":"https://api.github.com/repos/doctrine/mongodb-odm/pulls/comments{/number}","comments_url":"https://api.github.com/repos/doctrine/mongodb-odm/issues/1298/comments","statuses_url":"https://api.github.com/repos/doctrine/mongodb-odm/statuses/ae1cb255bdb2ab8c2d4b7a282165882e226394f5","head":{"label":"narcoticfresh:feature/regex-on-identifier","ref":"feature/regex-on-identifier","sha":"ae1cb255bdb2ab8c2d4b7a282165882e226394f5","user":{"login":"narcoticfresh","id":245441,"avatar_url":"https://avatars.githubusercontent.com/u/245441?v=3","gravatar_id":"","url":"https://api.github.com/users/narcoticfresh","html_url":"https://github.com/narcoticfresh","followers_url":"https://api.github.com/users/narcoticfresh/followers","following_url":"https://api.github.com/users/narcoticfresh/following{/other_user}","gists_url":"https://api.github.com/users/narcoticfresh/gists{/gist_id}","starred_url":"https://api.github.com/users/narcoticfresh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/narcoticfresh/subscriptions","organizations_url":"https://api.github.com/users/narcoticfresh/orgs","repos_url":"https://api.github.com/users/narcoticfresh/repos","events_url":"https://api.github.com/users/narcoticfresh/events{/privacy}","received_events_url":"https://api.github.com/users/narcoticfresh/received_events","type":"User","site_admin":false},"repo":{"id":47535806,"name":"mongodb-odm","full_name":"narcoticfresh/mongodb-odm","owner":{"login":"narcoticfresh","id":245441,"avatar_url":"https://avatars.githubusercontent.com/u/245441?v=3","gravatar_id":"","url":"https://api.github.com/users/narcoticfresh","html_url":"https://github.com/narcoticfresh","followers_url":"https://api.github.com/users/narcoticfresh/followers","following_url":"https://api.github.com/users/narcoticfresh/following{/other_user}","gists_url":"https://api.github.com/users/narcoticfresh/gists{/gist_id}","starred_url":"https://api.github.com/users/narcoticfresh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/narcoticfresh/subscriptions","organizations_url":"https://api.github.com/users/narcoticfresh/orgs","repos_url":"https://api.github.com/users/narcoticfresh/repos","events_url":"https://api.github.com/users/narcoticfresh/events{/privacy}","received_events_url":"https://api.github.com/users/narcoticfresh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/narcoticfresh/mongodb-odm","description":"Doctrine MongoDB Object Document Mapper (ODM)","fork":true,"url":"https://api.github.com/repos/narcoticfresh/mongodb-odm","forks_url":"https://api.github.com/repos/narcoticfresh/mongodb-odm/forks","keys_url":"https://api.github.com/repos/narcoticfresh/mongodb-odm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/narcoticfresh/mongodb-odm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/narcoticfresh/mongodb-odm/teams","hooks_url":"https://api.github.com/repos/narcoticfresh/mongodb-odm/hooks","issue_events_url":"https://api.github.com/repos/narcoticfresh/mongodb-odm/issues/events{/number}","events_url":"https://api.github.com/repos/narcoticfresh/mongodb-odm/events","assignees_url":"https://api.github.com/repos/narcoticfresh/mongodb-odm/assignees{/user}","branches_url":"https://api.github.com/repos/narcoticfresh/mongodb-odm/branches{/branch}","tags_url":"https://api.github.com/repos/narcoticfresh/mongodb-odm/tags","blobs_url":"https://api.github.com/repos/narcoticfresh/mongodb-odm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/narcoticfresh/mongodb-odm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/narcoticfresh/mongodb-odm/git/refs{/sha}","trees_url":"https://api.github.com/repos/narcoticfresh/mongodb-odm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/narcoticfresh/mongodb-odm/statuses/{sha}","languages_url":"https://api.github.com/repos/narcoticfresh/mongodb-odm/languages","stargazers_url":"https://api.github.com/repos/narcoticfresh/mongodb-odm/stargazers","contributors_url":"https://api.github.com/repos/narcoticfresh/mongodb-odm/contributors","subscribers_url":"https://api.github.com/repos/narcoticfresh/mongodb-odm/subscribers","subscription_url":"https://api.github.com/repos/narcoticfresh/mongodb-odm/subscription","commits_url":"https://api.github.com/repos/narcoticfresh/mongodb-odm/commits{/sha}","git_commits_url":"https://api.github.com/repos/narcoticfresh/mongodb-odm/git/commits{/sha}","comments_url":"https://api.github.com/repos/narcoticfresh/mongodb-odm/comments{/number}","issue_comment_url":"https://api.github.com/repos/narcoticfresh/mongodb-odm/issues/comments{/number}","contents_url":"https://api.github.com/repos/narcoticfresh/mongodb-odm/contents/{+path}","compare_url":"https://api.github.com/repos/narcoticfresh/mongodb-odm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/narcoticfresh/mongodb-odm/merges","archive_url":"https://api.github.com/repos/narcoticfresh/mongodb-odm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/narcoticfresh/mongodb-odm/downloads","issues_url":"https://api.github.com/repos/narcoticfresh/mongodb-odm/issues{/number}","pulls_url":"https://api.github.com/repos/narcoticfresh/mongodb-odm/pulls{/number}","milestones_url":"https://api.github.com/repos/narcoticfresh/mongodb-odm/milestones{/number}","notifications_url":"https://api.github.com/repos/narcoticfresh/mongodb-odm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/narcoticfresh/mongodb-odm/labels{/name}","releases_url":"https://api.github.com/repos/narcoticfresh/mongodb-odm/releases{/id}","created_at":"2015-12-07T07:16:10Z","updated_at":"2015-12-07T07:16:12Z","pushed_at":"2015-12-07T12:29:04Z","git_url":"git://github.com/narcoticfresh/mongodb-odm.git","ssh_url":"git@github.com:narcoticfresh/mongodb-odm.git","clone_url":"https://github.com/narcoticfresh/mongodb-odm.git","svn_url":"https://github.com/narcoticfresh/mongodb-odm","homepage":"http://docs.doctrine-project.org/projects/doctrine-mongodb-odm/en/latest/","size":6847,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"doctrine:master","ref":"master","sha":"2d99c1ee4fb575a1e340bec9771afe9a148c0aab","user":{"login":"doctrine","id":209254,"avatar_url":"https://avatars.githubusercontent.com/u/209254?v=3","gravatar_id":"","url":"https://api.github.com/users/doctrine","html_url":"https://github.com/doctrine","followers_url":"https://api.github.com/users/doctrine/followers","following_url":"https://api.github.com/users/doctrine/following{/other_user}","gists_url":"https://api.github.com/users/doctrine/gists{/gist_id}","starred_url":"https://api.github.com/users/doctrine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doctrine/subscriptions","organizations_url":"https://api.github.com/users/doctrine/orgs","repos_url":"https://api.github.com/users/doctrine/repos","events_url":"https://api.github.com/users/doctrine/events{/privacy}","received_events_url":"https://api.github.com/users/doctrine/received_events","type":"Organization","site_admin":false},"repo":{"id":677781,"name":"mongodb-odm","full_name":"doctrine/mongodb-odm","owner":{"login":"doctrine","id":209254,"avatar_url":"https://avatars.githubusercontent.com/u/209254?v=3","gravatar_id":"","url":"https://api.github.com/users/doctrine","html_url":"https://github.com/doctrine","followers_url":"https://api.github.com/users/doctrine/followers","following_url":"https://api.github.com/users/doctrine/following{/other_user}","gists_url":"https://api.github.com/users/doctrine/gists{/gist_id}","starred_url":"https://api.github.com/users/doctrine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doctrine/subscriptions","organizations_url":"https://api.github.com/users/doctrine/orgs","repos_url":"https://api.github.com/users/doctrine/repos","events_url":"https://api.github.com/users/doctrine/events{/privacy}","received_events_url":"https://api.github.com/users/doctrine/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/doctrine/mongodb-odm","description":"Doctrine MongoDB Object Document Mapper (ODM)","fork":false,"url":"https://api.github.com/repos/doctrine/mongodb-odm","forks_url":"https://api.github.com/repos/doctrine/mongodb-odm/forks","keys_url":"https://api.github.com/repos/doctrine/mongodb-odm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/doctrine/mongodb-odm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/doctrine/mongodb-odm/teams","hooks_url":"https://api.github.com/repos/doctrine/mongodb-odm/hooks","issue_events_url":"https://api.github.com/repos/doctrine/mongodb-odm/issues/events{/number}","events_url":"https://api.github.com/repos/doctrine/mongodb-odm/events","assignees_url":"https://api.github.com/repos/doctrine/mongodb-odm/assignees{/user}","branches_url":"https://api.github.com/repos/doctrine/mongodb-odm/branches{/branch}","tags_url":"https://api.github.com/repos/doctrine/mongodb-odm/tags","blobs_url":"https://api.github.com/repos/doctrine/mongodb-odm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/doctrine/mongodb-odm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/doctrine/mongodb-odm/git/refs{/sha}","trees_url":"https://api.github.com/repos/doctrine/mongodb-odm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/doctrine/mongodb-odm/statuses/{sha}","languages_url":"https://api.github.com/repos/doctrine/mongodb-odm/languages","stargazers_url":"https://api.github.com/repos/doctrine/mongodb-odm/stargazers","contributors_url":"https://api.github.com/repos/doctrine/mongodb-odm/contributors","subscribers_url":"https://api.github.com/repos/doctrine/mongodb-odm/subscribers","subscription_url":"https://api.github.com/repos/doctrine/mongodb-odm/subscription","commits_url":"https://api.github.com/repos/doctrine/mongodb-odm/commits{/sha}","git_commits_url":"https://api.github.com/repos/doctrine/mongodb-odm/git/commits{/sha}","comments_url":"https://api.github.com/repos/doctrine/mongodb-odm/comments{/number}","issue_comment_url":"https://api.github.com/repos/doctrine/mongodb-odm/issues/comments{/number}","contents_url":"https://api.github.com/repos/doctrine/mongodb-odm/contents/{+path}","compare_url":"https://api.github.com/repos/doctrine/mongodb-odm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/doctrine/mongodb-odm/merges","archive_url":"https://api.github.com/repos/doctrine/mongodb-odm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/doctrine/mongodb-odm/downloads","issues_url":"https://api.github.com/repos/doctrine/mongodb-odm/issues{/number}","pulls_url":"https://api.github.com/repos/doctrine/mongodb-odm/pulls{/number}","milestones_url":"https://api.github.com/repos/doctrine/mongodb-odm/milestones{/number}","notifications_url":"https://api.github.com/repos/doctrine/mongodb-odm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/doctrine/mongodb-odm/labels{/name}","releases_url":"https://api.github.com/repos/doctrine/mongodb-odm/releases{/id}","created_at":"2010-05-20T20:20:00Z","updated_at":"2015-12-06T20:37:43Z","pushed_at":"2015-12-09T07:45:36Z","git_url":"git://github.com/doctrine/mongodb-odm.git","ssh_url":"git@github.com:doctrine/mongodb-odm.git","clone_url":"https://github.com/doctrine/mongodb-odm.git","svn_url":"https://github.com/doctrine/mongodb-odm","homepage":"http://docs.doctrine-project.org/projects/doctrine-mongodb-odm/en/latest/","size":8872,"stargazers_count":582,"watchers_count":582,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":346,"mirror_url":null,"open_issues_count":158,"forks":346,"open_issues":158,"watchers":582,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/doctrine/mongodb-odm/pulls/1298"},"html":{"href":"https://github.com/doctrine/mongodb-odm/pull/1298"},"issue":{"href":"https://api.github.com/repos/doctrine/mongodb-odm/issues/1298"},"comments":{"href":"https://api.github.com/repos/doctrine/mongodb-odm/issues/1298/comments"},"review_comments":{"href":"https://api.github.com/repos/doctrine/mongodb-odm/pulls/1298/comments"},"review_comment":{"href":"https://api.github.com/repos/doctrine/mongodb-odm/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/doctrine/mongodb-odm/pulls/1298/commits"},"statuses":{"href":"https://api.github.com/repos/doctrine/mongodb-odm/statuses/ae1cb255bdb2ab8c2d4b7a282165882e226394f5"}}}}