{"action":"created","comment":{"url":"https://api.github.com/repos/fsi-open/datasource-bundle/pulls/comments/89273463","pull_request_review_id":9818779,"id":89273463,"diff_hunk":"@@ -41,26 +76,322 @@ public function getExtendedFieldTypes()\n      */\n     public function initOptions(FieldTypeInterface $field)\n     {\n-        if ($field->getComparison() == 'isNull') {\n-            $field->getOptionsResolver()\n-                ->setDefaults(array(\n-                    'form_options' => array(\n-                        'choices' => array(\n-                            'null' => $this->translator->trans('datasource.form.choices.is_null', array(), 'DataSourceBundle'),\n-                            'no_null' => $this->translator->trans('datasource.form.choices.is_not_null', array(), 'DataSourceBundle')\n-                        )\n-                    )\n-                ));\n-        } else if ($field->getType() == 'boolean') {\n-            $field->getOptionsResolver()\n-                ->setDefaults(array(\n-                    'form_options' => array(\n-                        'choices' => array(\n-                            '1' => $this->translator->trans('datasource.form.choices.yes', array(), 'DataSourceBundle'),\n-                            '0' => $this->translator->trans('datasource.form.choices.no', array(), 'DataSourceBundle')\n-                        )\n+        $field->getOptionsResolver()\n+            ->setDefaults(array(\n+                'form_filter' => true,\n+                'form_options' => array(),\n+                'form_from_options' => array(),\n+                'form_to_options' =>array()\n+            ))\n+            ->setDefined(array(\n+                'form_type',\n+                'form_order'\n+            ))\n+            ->setAllowedTypes('form_filter', 'bool')\n+            ->setAllowedTypes('form_options', 'array')\n+            ->setAllowedTypes('form_from_options', 'array')\n+            ->setAllowedTypes('form_to_options', 'array')\n+            ->setAllowedTypes('form_order', 'integer')\n+            ->setAllowedTypes('form_type', 'string')\n+        ;\n+    }\n+\n+    /**\n+     * {@inheritdoc}\n+     */\n+    public function postBuildView(FieldEvent\\ViewEventArgs $event)\n+    {\n+        $field = $event->getField();\n+        $view = $event->getView();\n+\n+        if ($form = $this->getForm($field)) {\n+            $view->setAttribute('form', $form->createView());\n+        }\n+    }\n+\n+    /**\n+     * {@inheritdoc}\n+     */\n+    public function preBindParameter(FieldEvent\\ParameterEventArgs $event)\n+    {\n+        $field = $event->getField();\n+        $field_oid = spl_object_hash($field);\n+        $parameter = $event->getParameter();\n+\n+        if (!$form = $this->getForm($field)) {","path":"DataSource/Extension/Symfony/Form/Field/FormFieldExtension.php","position":135,"original_position":135,"commit_id":"9faa7286d1d0d2d7621f29fc13126b9d7daadef9","original_commit_id":"9faa7286d1d0d2d7621f29fc13126b9d7daadef9","user":{"login":"szymach","id":2230556,"avatar_url":"https://avatars.githubusercontent.com/u/2230556?v=3","gravatar_id":"","url":"https://api.github.com/users/szymach","html_url":"https://github.com/szymach","followers_url":"https://api.github.com/users/szymach/followers","following_url":"https://api.github.com/users/szymach/following{/other_user}","gists_url":"https://api.github.com/users/szymach/gists{/gist_id}","starred_url":"https://api.github.com/users/szymach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/szymach/subscriptions","organizations_url":"https://api.github.com/users/szymach/orgs","repos_url":"https://api.github.com/users/szymach/repos","events_url":"https://api.github.com/users/szymach/events{/privacy}","received_events_url":"https://api.github.com/users/szymach/received_events","type":"User","site_admin":false},"body":"I'd move this condition above the line `$field_oid = spl_object_hash($field);` to prevent unnecessary steps, also please remove assignment from the condition statement :)","created_at":"2016-11-23T08:48:03Z","updated_at":"2016-11-23T08:48:03Z","html_url":"https://github.com/fsi-open/datasource-bundle/pull/50#discussion_r89273463","pull_request_url":"https://api.github.com/repos/fsi-open/datasource-bundle/pulls/50","_links":{"self":{"href":"https://api.github.com/repos/fsi-open/datasource-bundle/pulls/comments/89273463"},"html":{"href":"https://github.com/fsi-open/datasource-bundle/pull/50#discussion_r89273463"},"pull_request":{"href":"https://api.github.com/repos/fsi-open/datasource-bundle/pulls/50"}}},"pull_request":{"url":"https://api.github.com/repos/fsi-open/datasource-bundle/pulls/50","id":94829898,"html_url":"https://github.com/fsi-open/datasource-bundle/pull/50","diff_url":"https://github.com/fsi-open/datasource-bundle/pull/50.diff","patch_url":"https://github.com/fsi-open/datasource-bundle/pull/50.patch","issue_url":"https://api.github.com/repos/fsi-open/datasource-bundle/issues/50","number":50,"state":"open","locked":false,"title":"Moved symfony extensions from component into bundle","user":{"login":"chives","id":1170578,"avatar_url":"https://avatars.githubusercontent.com/u/1170578?v=3","gravatar_id":"","url":"https://api.github.com/users/chives","html_url":"https://github.com/chives","followers_url":"https://api.github.com/users/chives/followers","following_url":"https://api.github.com/users/chives/following{/other_user}","gists_url":"https://api.github.com/users/chives/gists{/gist_id}","starred_url":"https://api.github.com/users/chives/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chives/subscriptions","organizations_url":"https://api.github.com/users/chives/orgs","repos_url":"https://api.github.com/users/chives/repos","events_url":"https://api.github.com/users/chives/events{/privacy}","received_events_url":"https://api.github.com/users/chives/received_events","type":"User","site_admin":false},"body":"Fixes #49 ","created_at":"2016-11-22T14:58:13Z","updated_at":"2016-11-23T08:56:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1425f4a0990df93082770816b3b62b86a01e5876","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/fsi-open/datasource-bundle/pulls/50/commits","review_comments_url":"https://api.github.com/repos/fsi-open/datasource-bundle/pulls/50/comments","review_comment_url":"https://api.github.com/repos/fsi-open/datasource-bundle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fsi-open/datasource-bundle/issues/50/comments","statuses_url":"https://api.github.com/repos/fsi-open/datasource-bundle/statuses/9faa7286d1d0d2d7621f29fc13126b9d7daadef9","head":{"label":"chives:dev","ref":"dev","sha":"9faa7286d1d0d2d7621f29fc13126b9d7daadef9","user":{"login":"chives","id":1170578,"avatar_url":"https://avatars.githubusercontent.com/u/1170578?v=3","gravatar_id":"","url":"https://api.github.com/users/chives","html_url":"https://github.com/chives","followers_url":"https://api.github.com/users/chives/followers","following_url":"https://api.github.com/users/chives/following{/other_user}","gists_url":"https://api.github.com/users/chives/gists{/gist_id}","starred_url":"https://api.github.com/users/chives/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chives/subscriptions","organizations_url":"https://api.github.com/users/chives/orgs","repos_url":"https://api.github.com/users/chives/repos","events_url":"https://api.github.com/users/chives/events{/privacy}","received_events_url":"https://api.github.com/users/chives/received_events","type":"User","site_admin":false},"repo":{"id":11252779,"name":"datasource-bundle","full_name":"chives/datasource-bundle","owner":{"login":"chives","id":1170578,"avatar_url":"https://avatars.githubusercontent.com/u/1170578?v=3","gravatar_id":"","url":"https://api.github.com/users/chives","html_url":"https://github.com/chives","followers_url":"https://api.github.com/users/chives/followers","following_url":"https://api.github.com/users/chives/following{/other_user}","gists_url":"https://api.github.com/users/chives/gists{/gist_id}","starred_url":"https://api.github.com/users/chives/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chives/subscriptions","organizations_url":"https://api.github.com/users/chives/orgs","repos_url":"https://api.github.com/users/chives/repos","events_url":"https://api.github.com/users/chives/events{/privacy}","received_events_url":"https://api.github.com/users/chives/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chives/datasource-bundle","description":"Main purpose of this bundle is to register FSi DataSource Component service and twig datasource rendering functions","fork":true,"url":"https://api.github.com/repos/chives/datasource-bundle","forks_url":"https://api.github.com/repos/chives/datasource-bundle/forks","keys_url":"https://api.github.com/repos/chives/datasource-bundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chives/datasource-bundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chives/datasource-bundle/teams","hooks_url":"https://api.github.com/repos/chives/datasource-bundle/hooks","issue_events_url":"https://api.github.com/repos/chives/datasource-bundle/issues/events{/number}","events_url":"https://api.github.com/repos/chives/datasource-bundle/events","assignees_url":"https://api.github.com/repos/chives/datasource-bundle/assignees{/user}","branches_url":"https://api.github.com/repos/chives/datasource-bundle/branches{/branch}","tags_url":"https://api.github.com/repos/chives/datasource-bundle/tags","blobs_url":"https://api.github.com/repos/chives/datasource-bundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chives/datasource-bundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chives/datasource-bundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/chives/datasource-bundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chives/datasource-bundle/statuses/{sha}","languages_url":"https://api.github.com/repos/chives/datasource-bundle/languages","stargazers_url":"https://api.github.com/repos/chives/datasource-bundle/stargazers","contributors_url":"https://api.github.com/repos/chives/datasource-bundle/contributors","subscribers_url":"https://api.github.com/repos/chives/datasource-bundle/subscribers","subscription_url":"https://api.github.com/repos/chives/datasource-bundle/subscription","commits_url":"https://api.github.com/repos/chives/datasource-bundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/chives/datasource-bundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/chives/datasource-bundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/chives/datasource-bundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/chives/datasource-bundle/contents/{+path}","compare_url":"https://api.github.com/repos/chives/datasource-bundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chives/datasource-bundle/merges","archive_url":"https://api.github.com/repos/chives/datasource-bundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chives/datasource-bundle/downloads","issues_url":"https://api.github.com/repos/chives/datasource-bundle/issues{/number}","pulls_url":"https://api.github.com/repos/chives/datasource-bundle/pulls{/number}","milestones_url":"https://api.github.com/repos/chives/datasource-bundle/milestones{/number}","notifications_url":"https://api.github.com/repos/chives/datasource-bundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chives/datasource-bundle/labels{/name}","releases_url":"https://api.github.com/repos/chives/datasource-bundle/releases{/id}","deployments_url":"https://api.github.com/repos/chives/datasource-bundle/deployments","created_at":"2013-07-08T11:33:00Z","updated_at":"2014-03-30T19:45:56Z","pushed_at":"2016-11-22T15:29:12Z","git_url":"git://github.com/chives/datasource-bundle.git","ssh_url":"git@github.com:chives/datasource-bundle.git","clone_url":"https://github.com/chives/datasource-bundle.git","svn_url":"https://github.com/chives/datasource-bundle","homepage":null,"size":156,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"fsi-open:master","ref":"master","sha":"adda5041962623a3f017aef812e5ea028cf8bee0","user":{"login":"fsi-open","id":2317182,"avatar_url":"https://avatars.githubusercontent.com/u/2317182?v=3","gravatar_id":"","url":"https://api.github.com/users/fsi-open","html_url":"https://github.com/fsi-open","followers_url":"https://api.github.com/users/fsi-open/followers","following_url":"https://api.github.com/users/fsi-open/following{/other_user}","gists_url":"https://api.github.com/users/fsi-open/gists{/gist_id}","starred_url":"https://api.github.com/users/fsi-open/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fsi-open/subscriptions","organizations_url":"https://api.github.com/users/fsi-open/orgs","repos_url":"https://api.github.com/users/fsi-open/repos","events_url":"https://api.github.com/users/fsi-open/events{/privacy}","received_events_url":"https://api.github.com/users/fsi-open/received_events","type":"Organization","site_admin":false},"repo":{"id":7560262,"name":"datasource-bundle","full_name":"fsi-open/datasource-bundle","owner":{"login":"fsi-open","id":2317182,"avatar_url":"https://avatars.githubusercontent.com/u/2317182?v=3","gravatar_id":"","url":"https://api.github.com/users/fsi-open","html_url":"https://github.com/fsi-open","followers_url":"https://api.github.com/users/fsi-open/followers","following_url":"https://api.github.com/users/fsi-open/following{/other_user}","gists_url":"https://api.github.com/users/fsi-open/gists{/gist_id}","starred_url":"https://api.github.com/users/fsi-open/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fsi-open/subscriptions","organizations_url":"https://api.github.com/users/fsi-open/orgs","repos_url":"https://api.github.com/users/fsi-open/repos","events_url":"https://api.github.com/users/fsi-open/events{/privacy}","received_events_url":"https://api.github.com/users/fsi-open/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fsi-open/datasource-bundle","description":"Main purpose of this bundle is to register FSi DataSource Component service and twig datasource rendering functions","fork":false,"url":"https://api.github.com/repos/fsi-open/datasource-bundle","forks_url":"https://api.github.com/repos/fsi-open/datasource-bundle/forks","keys_url":"https://api.github.com/repos/fsi-open/datasource-bundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fsi-open/datasource-bundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fsi-open/datasource-bundle/teams","hooks_url":"https://api.github.com/repos/fsi-open/datasource-bundle/hooks","issue_events_url":"https://api.github.com/repos/fsi-open/datasource-bundle/issues/events{/number}","events_url":"https://api.github.com/repos/fsi-open/datasource-bundle/events","assignees_url":"https://api.github.com/repos/fsi-open/datasource-bundle/assignees{/user}","branches_url":"https://api.github.com/repos/fsi-open/datasource-bundle/branches{/branch}","tags_url":"https://api.github.com/repos/fsi-open/datasource-bundle/tags","blobs_url":"https://api.github.com/repos/fsi-open/datasource-bundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fsi-open/datasource-bundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fsi-open/datasource-bundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/fsi-open/datasource-bundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fsi-open/datasource-bundle/statuses/{sha}","languages_url":"https://api.github.com/repos/fsi-open/datasource-bundle/languages","stargazers_url":"https://api.github.com/repos/fsi-open/datasource-bundle/stargazers","contributors_url":"https://api.github.com/repos/fsi-open/datasource-bundle/contributors","subscribers_url":"https://api.github.com/repos/fsi-open/datasource-bundle/subscribers","subscription_url":"https://api.github.com/repos/fsi-open/datasource-bundle/subscription","commits_url":"https://api.github.com/repos/fsi-open/datasource-bundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/fsi-open/datasource-bundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/fsi-open/datasource-bundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/fsi-open/datasource-bundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/fsi-open/datasource-bundle/contents/{+path}","compare_url":"https://api.github.com/repos/fsi-open/datasource-bundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fsi-open/datasource-bundle/merges","archive_url":"https://api.github.com/repos/fsi-open/datasource-bundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fsi-open/datasource-bundle/downloads","issues_url":"https://api.github.com/repos/fsi-open/datasource-bundle/issues{/number}","pulls_url":"https://api.github.com/repos/fsi-open/datasource-bundle/pulls{/number}","milestones_url":"https://api.github.com/repos/fsi-open/datasource-bundle/milestones{/number}","notifications_url":"https://api.github.com/repos/fsi-open/datasource-bundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fsi-open/datasource-bundle/labels{/name}","releases_url":"https://api.github.com/repos/fsi-open/datasource-bundle/releases{/id}","deployments_url":"https://api.github.com/repos/fsi-open/datasource-bundle/deployments","created_at":"2013-01-11T13:30:56Z","updated_at":"2016-01-16T10:44:45Z","pushed_at":"2016-11-22T15:29:13Z","git_url":"git://github.com/fsi-open/datasource-bundle.git","ssh_url":"git@github.com:fsi-open/datasource-bundle.git","clone_url":"https://github.com/fsi-open/datasource-bundle.git","svn_url":"https://github.com/fsi-open/datasource-bundle","homepage":null,"size":141,"stargazers_count":6,"watchers_count":6,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":6,"forks":11,"open_issues":6,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fsi-open/datasource-bundle/pulls/50"},"html":{"href":"https://github.com/fsi-open/datasource-bundle/pull/50"},"issue":{"href":"https://api.github.com/repos/fsi-open/datasource-bundle/issues/50"},"comments":{"href":"https://api.github.com/repos/fsi-open/datasource-bundle/issues/50/comments"},"review_comments":{"href":"https://api.github.com/repos/fsi-open/datasource-bundle/pulls/50/comments"},"review_comment":{"href":"https://api.github.com/repos/fsi-open/datasource-bundle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fsi-open/datasource-bundle/pulls/50/commits"},"statuses":{"href":"https://api.github.com/repos/fsi-open/datasource-bundle/statuses/9faa7286d1d0d2d7621f29fc13126b9d7daadef9"}}}}
{"actor":{"display_login":"szymach"}}