{"action":"created","comment":{"url":"https://api.github.com/repos/api-platform/core/pulls/comments/58653908","id":58653908,"diff_hunk":"@@ -0,0 +1,157 @@\n+<?php\n+\n+/*\n+ * This file is part of the API Platform project.\n+ *\n+ * (c) Kévin Dunglas <dunglas@gmail.com>\n+ *\n+ * For the full copyright and license information, please view the LICENSE\n+ * file that was distributed with this source code.\n+ */\n+\n+namespace ApiPlatform\\Core\\Bridge\\Doctrine\\Orm\\Filter;\n+\n+use ApiPlatform\\Core\\Bridge\\Doctrine\\Orm\\Util\\QueryNameGenerator;\n+use Doctrine\\Common\\Persistence\\ManagerRegistry;\n+use Doctrine\\ORM\\QueryBuilder;\n+use Symfony\\Component\\HttpFoundation\\Request;\n+use Symfony\\Component\\HttpFoundation\\RequestStack;\n+\n+/**\n+ * Filter by a numeric value.\n+ *\n+ * @author Kévin Dunglas <dunglas@gmail.com>\n+ * @author Amrouche Hamza <hamza.simperfit@gmail.com>\n+ */\n+class NumericFilter extends AbstractFilter\n+{\n+    /*\n+     * Type of numeric in Doctrine see http://doctrine-orm.readthedocs.org/projects/doctrine-dbal/en/latest/reference/types.html\n+     *\n+     */\n+    const DOCTRINE_NUMERIC_TYPES = [\n+        'bigint' => true,","path":"src/Bridge/Doctrine/Orm/Filter/NumericFilter.php","position":33,"original_position":33,"commit_id":"f4a1a9839c11e5f65f59f53119f98601486e6666","original_commit_id":"f4a1a9839c11e5f65f59f53119f98601486e6666","user":{"login":"teohhanhui","id":548843,"avatar_url":"https://avatars.githubusercontent.com/u/548843?v=3","gravatar_id":"","url":"https://api.github.com/users/teohhanhui","html_url":"https://github.com/teohhanhui","followers_url":"https://api.github.com/users/teohhanhui/followers","following_url":"https://api.github.com/users/teohhanhui/following{/other_user}","gists_url":"https://api.github.com/users/teohhanhui/gists{/gist_id}","starred_url":"https://api.github.com/users/teohhanhui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teohhanhui/subscriptions","organizations_url":"https://api.github.com/users/teohhanhui/orgs","repos_url":"https://api.github.com/users/teohhanhui/repos","events_url":"https://api.github.com/users/teohhanhui/events{/privacy}","received_events_url":"https://api.github.com/users/teohhanhui/received_events","type":"User","site_admin":false},"body":"I'd prefer using the class constants:\r\n\r\n```php\r\n// use Doctrine\\DBAL\\Types\\Type as DBALType;\r\n\r\nconst DOCTRINE_NUMERIC_TYPES = [\r\n    DBALType::BIGINT => true,\r\n    DBALType::DECIMAL => true,\r\n    DBALType::FLOAT => true,\r\n    DBALType::INTEGER => true,\r\n    DBALType::SMALLINT => true,\r\n];\r\n```\r\n\r\nsorted, and `time` is not a numeric type, according to the linked Doctrine reference.","created_at":"2016-04-06T05:51:41Z","updated_at":"2016-04-06T05:51:41Z","html_url":"https://github.com/api-platform/core/pull/448#discussion_r58653908","pull_request_url":"https://api.github.com/repos/api-platform/core/pulls/448","_links":{"self":{"href":"https://api.github.com/repos/api-platform/core/pulls/comments/58653908"},"html":{"href":"https://github.com/api-platform/core/pull/448#discussion_r58653908"},"pull_request":{"href":"https://api.github.com/repos/api-platform/core/pulls/448"}}},"pull_request":{"url":"https://api.github.com/repos/api-platform/core/pulls/448","id":61841962,"html_url":"https://github.com/api-platform/core/pull/448","diff_url":"https://github.com/api-platform/core/pull/448.diff","patch_url":"https://github.com/api-platform/core/pull/448.patch","issue_url":"https://api.github.com/repos/api-platform/core/issues/448","number":448,"state":"open","locked":false,"title":"Add BooleanFilter and NumericFilter","user":{"login":"Simperfit","id":3451634,"avatar_url":"https://avatars.githubusercontent.com/u/3451634?v=3","gravatar_id":"","url":"https://api.github.com/users/Simperfit","html_url":"https://github.com/Simperfit","followers_url":"https://api.github.com/users/Simperfit/followers","following_url":"https://api.github.com/users/Simperfit/following{/other_user}","gists_url":"https://api.github.com/users/Simperfit/gists{/gist_id}","starred_url":"https://api.github.com/users/Simperfit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Simperfit/subscriptions","organizations_url":"https://api.github.com/users/Simperfit/orgs","repos_url":"https://api.github.com/users/Simperfit/repos","events_url":"https://api.github.com/users/Simperfit/events{/privacy}","received_events_url":"https://api.github.com/users/Simperfit/received_events","type":"User","site_admin":false},"body":"| Q             | A\r\n| ------------- | ---\r\n| Bug fix?      | yes\r\n| New feature?  | yes\r\n| BC breaks?    | no\r\n| Deprecations? | no\r\n| Tests pass?   | no\r\n| Fixed tickets | #352 \r\n| License       | MIT\r\n| Doc PR        | api-platform/doc#38\r\n\r\nI have added an boolean filter based on the order filter with the test.\r\n\r\n- [x] [Boolean Filter]\r\n- [x] [Numeric Filter] \r\n\r\n","created_at":"2016-03-06T12:53:28Z","updated_at":"2016-04-06T05:51:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"80baa3dba6723847a31e2c78113891e03003ccc4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/api-platform/core/pulls/448/commits","review_comments_url":"https://api.github.com/repos/api-platform/core/pulls/448/comments","review_comment_url":"https://api.github.com/repos/api-platform/core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/api-platform/core/issues/448/comments","statuses_url":"https://api.github.com/repos/api-platform/core/statuses/f4a1a9839c11e5f65f59f53119f98601486e6666","head":{"label":"Simperfit:issues-352","ref":"issues-352","sha":"f4a1a9839c11e5f65f59f53119f98601486e6666","user":{"login":"Simperfit","id":3451634,"avatar_url":"https://avatars.githubusercontent.com/u/3451634?v=3","gravatar_id":"","url":"https://api.github.com/users/Simperfit","html_url":"https://github.com/Simperfit","followers_url":"https://api.github.com/users/Simperfit/followers","following_url":"https://api.github.com/users/Simperfit/following{/other_user}","gists_url":"https://api.github.com/users/Simperfit/gists{/gist_id}","starred_url":"https://api.github.com/users/Simperfit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Simperfit/subscriptions","organizations_url":"https://api.github.com/users/Simperfit/orgs","repos_url":"https://api.github.com/users/Simperfit/repos","events_url":"https://api.github.com/users/Simperfit/events{/privacy}","received_events_url":"https://api.github.com/users/Simperfit/received_events","type":"User","site_admin":false},"repo":{"id":53217809,"name":"core","full_name":"Simperfit/core","owner":{"login":"Simperfit","id":3451634,"avatar_url":"https://avatars.githubusercontent.com/u/3451634?v=3","gravatar_id":"","url":"https://api.github.com/users/Simperfit","html_url":"https://github.com/Simperfit","followers_url":"https://api.github.com/users/Simperfit/followers","following_url":"https://api.github.com/users/Simperfit/following{/other_user}","gists_url":"https://api.github.com/users/Simperfit/gists{/gist_id}","starred_url":"https://api.github.com/users/Simperfit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Simperfit/subscriptions","organizations_url":"https://api.github.com/users/Simperfit/orgs","repos_url":"https://api.github.com/users/Simperfit/repos","events_url":"https://api.github.com/users/Simperfit/events{/privacy}","received_events_url":"https://api.github.com/users/Simperfit/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Simperfit/core","description":"The Hypermedia REST API component of API Platform: JSON-LD and Hydra support, works with Symfony too","fork":true,"url":"https://api.github.com/repos/Simperfit/core","forks_url":"https://api.github.com/repos/Simperfit/core/forks","keys_url":"https://api.github.com/repos/Simperfit/core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Simperfit/core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Simperfit/core/teams","hooks_url":"https://api.github.com/repos/Simperfit/core/hooks","issue_events_url":"https://api.github.com/repos/Simperfit/core/issues/events{/number}","events_url":"https://api.github.com/repos/Simperfit/core/events","assignees_url":"https://api.github.com/repos/Simperfit/core/assignees{/user}","branches_url":"https://api.github.com/repos/Simperfit/core/branches{/branch}","tags_url":"https://api.github.com/repos/Simperfit/core/tags","blobs_url":"https://api.github.com/repos/Simperfit/core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Simperfit/core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Simperfit/core/git/refs{/sha}","trees_url":"https://api.github.com/repos/Simperfit/core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Simperfit/core/statuses/{sha}","languages_url":"https://api.github.com/repos/Simperfit/core/languages","stargazers_url":"https://api.github.com/repos/Simperfit/core/stargazers","contributors_url":"https://api.github.com/repos/Simperfit/core/contributors","subscribers_url":"https://api.github.com/repos/Simperfit/core/subscribers","subscription_url":"https://api.github.com/repos/Simperfit/core/subscription","commits_url":"https://api.github.com/repos/Simperfit/core/commits{/sha}","git_commits_url":"https://api.github.com/repos/Simperfit/core/git/commits{/sha}","comments_url":"https://api.github.com/repos/Simperfit/core/comments{/number}","issue_comment_url":"https://api.github.com/repos/Simperfit/core/issues/comments{/number}","contents_url":"https://api.github.com/repos/Simperfit/core/contents/{+path}","compare_url":"https://api.github.com/repos/Simperfit/core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Simperfit/core/merges","archive_url":"https://api.github.com/repos/Simperfit/core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Simperfit/core/downloads","issues_url":"https://api.github.com/repos/Simperfit/core/issues{/number}","pulls_url":"https://api.github.com/repos/Simperfit/core/pulls{/number}","milestones_url":"https://api.github.com/repos/Simperfit/core/milestones{/number}","notifications_url":"https://api.github.com/repos/Simperfit/core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Simperfit/core/labels{/name}","releases_url":"https://api.github.com/repos/Simperfit/core/releases{/id}","deployments_url":"https://api.github.com/repos/Simperfit/core/deployments","created_at":"2016-03-05T18:57:36Z","updated_at":"2016-03-05T18:57:38Z","pushed_at":"2016-04-04T21:53:20Z","git_url":"git://github.com/Simperfit/core.git","ssh_url":"git@github.com:Simperfit/core.git","clone_url":"https://github.com/Simperfit/core.git","svn_url":"https://github.com/Simperfit/core","homepage":"https://api-platform.com/doc/1.0/api-bundle/","size":1694,"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":"api-platform:master","ref":"master","sha":"1fcc149e12904167abf56d5c6b2ab42bbbefe9ed","user":{"login":"api-platform","id":13420081,"avatar_url":"https://avatars.githubusercontent.com/u/13420081?v=3","gravatar_id":"","url":"https://api.github.com/users/api-platform","html_url":"https://github.com/api-platform","followers_url":"https://api.github.com/users/api-platform/followers","following_url":"https://api.github.com/users/api-platform/following{/other_user}","gists_url":"https://api.github.com/users/api-platform/gists{/gist_id}","starred_url":"https://api.github.com/users/api-platform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/api-platform/subscriptions","organizations_url":"https://api.github.com/users/api-platform/orgs","repos_url":"https://api.github.com/users/api-platform/repos","events_url":"https://api.github.com/users/api-platform/events{/privacy}","received_events_url":"https://api.github.com/users/api-platform/received_events","type":"Organization","site_admin":false},"repo":{"id":29501260,"name":"core","full_name":"api-platform/core","owner":{"login":"api-platform","id":13420081,"avatar_url":"https://avatars.githubusercontent.com/u/13420081?v=3","gravatar_id":"","url":"https://api.github.com/users/api-platform","html_url":"https://github.com/api-platform","followers_url":"https://api.github.com/users/api-platform/followers","following_url":"https://api.github.com/users/api-platform/following{/other_user}","gists_url":"https://api.github.com/users/api-platform/gists{/gist_id}","starred_url":"https://api.github.com/users/api-platform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/api-platform/subscriptions","organizations_url":"https://api.github.com/users/api-platform/orgs","repos_url":"https://api.github.com/users/api-platform/repos","events_url":"https://api.github.com/users/api-platform/events{/privacy}","received_events_url":"https://api.github.com/users/api-platform/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/api-platform/core","description":"The Hypermedia REST API component of API Platform: JSON-LD and Hydra support, works with Symfony too","fork":false,"url":"https://api.github.com/repos/api-platform/core","forks_url":"https://api.github.com/repos/api-platform/core/forks","keys_url":"https://api.github.com/repos/api-platform/core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/api-platform/core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/api-platform/core/teams","hooks_url":"https://api.github.com/repos/api-platform/core/hooks","issue_events_url":"https://api.github.com/repos/api-platform/core/issues/events{/number}","events_url":"https://api.github.com/repos/api-platform/core/events","assignees_url":"https://api.github.com/repos/api-platform/core/assignees{/user}","branches_url":"https://api.github.com/repos/api-platform/core/branches{/branch}","tags_url":"https://api.github.com/repos/api-platform/core/tags","blobs_url":"https://api.github.com/repos/api-platform/core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/api-platform/core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/api-platform/core/git/refs{/sha}","trees_url":"https://api.github.com/repos/api-platform/core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/api-platform/core/statuses/{sha}","languages_url":"https://api.github.com/repos/api-platform/core/languages","stargazers_url":"https://api.github.com/repos/api-platform/core/stargazers","contributors_url":"https://api.github.com/repos/api-platform/core/contributors","subscribers_url":"https://api.github.com/repos/api-platform/core/subscribers","subscription_url":"https://api.github.com/repos/api-platform/core/subscription","commits_url":"https://api.github.com/repos/api-platform/core/commits{/sha}","git_commits_url":"https://api.github.com/repos/api-platform/core/git/commits{/sha}","comments_url":"https://api.github.com/repos/api-platform/core/comments{/number}","issue_comment_url":"https://api.github.com/repos/api-platform/core/issues/comments{/number}","contents_url":"https://api.github.com/repos/api-platform/core/contents/{+path}","compare_url":"https://api.github.com/repos/api-platform/core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/api-platform/core/merges","archive_url":"https://api.github.com/repos/api-platform/core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/api-platform/core/downloads","issues_url":"https://api.github.com/repos/api-platform/core/issues{/number}","pulls_url":"https://api.github.com/repos/api-platform/core/pulls{/number}","milestones_url":"https://api.github.com/repos/api-platform/core/milestones{/number}","notifications_url":"https://api.github.com/repos/api-platform/core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/api-platform/core/labels{/name}","releases_url":"https://api.github.com/repos/api-platform/core/releases{/id}","deployments_url":"https://api.github.com/repos/api-platform/core/deployments","created_at":"2015-01-19T23:05:56Z","updated_at":"2016-04-04T10:16:23Z","pushed_at":"2016-04-05T15:45:49Z","git_url":"git://github.com/api-platform/core.git","ssh_url":"git@github.com:api-platform/core.git","clone_url":"https://github.com/api-platform/core.git","svn_url":"https://github.com/api-platform/core","homepage":"https://api-platform.com/doc/1.0/api-bundle/","size":2073,"stargazers_count":304,"watchers_count":304,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":79,"mirror_url":null,"open_issues_count":92,"forks":79,"open_issues":92,"watchers":304,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/api-platform/core/pulls/448"},"html":{"href":"https://github.com/api-platform/core/pull/448"},"issue":{"href":"https://api.github.com/repos/api-platform/core/issues/448"},"comments":{"href":"https://api.github.com/repos/api-platform/core/issues/448/comments"},"review_comments":{"href":"https://api.github.com/repos/api-platform/core/pulls/448/comments"},"review_comment":{"href":"https://api.github.com/repos/api-platform/core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/api-platform/core/pulls/448/commits"},"statuses":{"href":"https://api.github.com/repos/api-platform/core/statuses/f4a1a9839c11e5f65f59f53119f98601486e6666"}}}}