{"action":"created","comment":{"url":"https://api.github.com/repos/Gizra/negawatt-server/pulls/comments/29316682","id":29316682,"diff_hunk":"@@ -70,8 +70,271 @@ public function publicFieldsInfo() {\n \n   /**\n    * {@inheritdoc}\n+   *\n+   * Overide to exclude meter field if no filter for meter was specified.\n+   */\n+  public function getPublicFields() {\n+    $public_fields = parent::getPublicFields();\n+\n+    // Get query filter.\n+    $request = $this->getRequest();\n+    $filter = !empty($request['filter']) ? $request['filter'] : array();\n+\n+    if (array_key_exists('meter', $filter)) {\n+      return $public_fields;\n+    }\n+\n+    // No filter for meters, remove meters field from public-fields.\n+    unset($public_fields['meter']);","path":"negawatt/modules/custom/negawatt_restful/plugins/restful/electricity/1.0/NegawattElectricityResource.class.php","position":19,"original_position":19,"commit_id":"f5e7167b061be88ee88a7a95dab41675a65f3b10","original_commit_id":"f5e7167b061be88ee88a7a95dab41675a65f3b10","user":{"login":"amitaibu","id":125707,"avatar_url":"https://avatars.githubusercontent.com/u/125707?v=3","gravatar_id":"","url":"https://api.github.com/users/amitaibu","html_url":"https://github.com/amitaibu","followers_url":"https://api.github.com/users/amitaibu/followers","following_url":"https://api.github.com/users/amitaibu/following{/other_user}","gists_url":"https://api.github.com/users/amitaibu/gists{/gist_id}","starred_url":"https://api.github.com/users/amitaibu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amitaibu/subscriptions","organizations_url":"https://api.github.com/users/amitaibu/orgs","repos_url":"https://api.github.com/users/amitaibu/repos","events_url":"https://api.github.com/users/amitaibu/events{/privacy}","received_events_url":"https://api.github.com/users/amitaibu/received_events","type":"User","site_admin":false},"body":"use ``access_callbacks`` on the meter","created_at":"2015-04-29T08:09:18Z","updated_at":"2015-04-29T08:09:18Z","html_url":"https://github.com/Gizra/negawatt-server/pull/466#discussion_r29316682","pull_request_url":"https://api.github.com/repos/Gizra/negawatt-server/pulls/466","_links":{"self":{"href":"https://api.github.com/repos/Gizra/negawatt-server/pulls/comments/29316682"},"html":{"href":"https://github.com/Gizra/negawatt-server/pull/466#discussion_r29316682"},"pull_request":{"href":"https://api.github.com/repos/Gizra/negawatt-server/pulls/466"}}},"pull_request":{"url":"https://api.github.com/repos/Gizra/negawatt-server/pulls/466","id":33336241,"html_url":"https://github.com/Gizra/negawatt-server/pull/466","diff_url":"https://github.com/Gizra/negawatt-server/pull/466.diff","patch_url":"https://github.com/Gizra/negawatt-server/pull/466.patch","issue_url":"https://api.github.com/repos/Gizra/negawatt-server/issues/466","number":466,"state":"open","locked":false,"title":"Fix NegawattFormatterMetersTotal to respond only to 'meters' request","user":{"login":"shahardo","id":4487099,"avatar_url":"https://avatars.githubusercontent.com/u/4487099?v=3","gravatar_id":"","url":"https://api.github.com/users/shahardo","html_url":"https://github.com/shahardo","followers_url":"https://api.github.com/users/shahardo/followers","following_url":"https://api.github.com/users/shahardo/following{/other_user}","gists_url":"https://api.github.com/users/shahardo/gists{/gist_id}","starred_url":"https://api.github.com/users/shahardo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shahardo/subscriptions","organizations_url":"https://api.github.com/users/shahardo/orgs","repos_url":"https://api.github.com/users/shahardo/repos","events_url":"https://api.github.com/users/shahardo/events{/privacy}","received_events_url":"https://api.github.com/users/shahardo/received_events","type":"User","site_admin":false},"body":"#461 ","created_at":"2015-04-15T09:21:13Z","updated_at":"2015-04-29T08:09:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7bdcc9929a219caeb53dae8828d12cc1bc1e3265","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Gizra/negawatt-server/pulls/466/commits","review_comments_url":"https://api.github.com/repos/Gizra/negawatt-server/pulls/466/comments","review_comment_url":"https://api.github.com/repos/Gizra/negawatt-server/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Gizra/negawatt-server/issues/466/comments","statuses_url":"https://api.github.com/repos/Gizra/negawatt-server/statuses/f5e7167b061be88ee88a7a95dab41675a65f3b10","head":{"label":"Gizra:461","ref":"461","sha":"f5e7167b061be88ee88a7a95dab41675a65f3b10","user":{"login":"Gizra","id":2484795,"avatar_url":"https://avatars.githubusercontent.com/u/2484795?v=3","gravatar_id":"","url":"https://api.github.com/users/Gizra","html_url":"https://github.com/Gizra","followers_url":"https://api.github.com/users/Gizra/followers","following_url":"https://api.github.com/users/Gizra/following{/other_user}","gists_url":"https://api.github.com/users/Gizra/gists{/gist_id}","starred_url":"https://api.github.com/users/Gizra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gizra/subscriptions","organizations_url":"https://api.github.com/users/Gizra/orgs","repos_url":"https://api.github.com/users/Gizra/repos","events_url":"https://api.github.com/users/Gizra/events{/privacy}","received_events_url":"https://api.github.com/users/Gizra/received_events","type":"Organization","site_admin":false},"repo":{"id":24016302,"name":"negawatt-server","full_name":"Gizra/negawatt-server","owner":{"login":"Gizra","id":2484795,"avatar_url":"https://avatars.githubusercontent.com/u/2484795?v=3","gravatar_id":"","url":"https://api.github.com/users/Gizra","html_url":"https://github.com/Gizra","followers_url":"https://api.github.com/users/Gizra/followers","following_url":"https://api.github.com/users/Gizra/following{/other_user}","gists_url":"https://api.github.com/users/Gizra/gists{/gist_id}","starred_url":"https://api.github.com/users/Gizra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gizra/subscriptions","organizations_url":"https://api.github.com/users/Gizra/orgs","repos_url":"https://api.github.com/users/Gizra/repos","events_url":"https://api.github.com/users/Gizra/events{/privacy}","received_events_url":"https://api.github.com/users/Gizra/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Gizra/negawatt-server","description":"negawatt data server","fork":false,"url":"https://api.github.com/repos/Gizra/negawatt-server","forks_url":"https://api.github.com/repos/Gizra/negawatt-server/forks","keys_url":"https://api.github.com/repos/Gizra/negawatt-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Gizra/negawatt-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Gizra/negawatt-server/teams","hooks_url":"https://api.github.com/repos/Gizra/negawatt-server/hooks","issue_events_url":"https://api.github.com/repos/Gizra/negawatt-server/issues/events{/number}","events_url":"https://api.github.com/repos/Gizra/negawatt-server/events","assignees_url":"https://api.github.com/repos/Gizra/negawatt-server/assignees{/user}","branches_url":"https://api.github.com/repos/Gizra/negawatt-server/branches{/branch}","tags_url":"https://api.github.com/repos/Gizra/negawatt-server/tags","blobs_url":"https://api.github.com/repos/Gizra/negawatt-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Gizra/negawatt-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Gizra/negawatt-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/Gizra/negawatt-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Gizra/negawatt-server/statuses/{sha}","languages_url":"https://api.github.com/repos/Gizra/negawatt-server/languages","stargazers_url":"https://api.github.com/repos/Gizra/negawatt-server/stargazers","contributors_url":"https://api.github.com/repos/Gizra/negawatt-server/contributors","subscribers_url":"https://api.github.com/repos/Gizra/negawatt-server/subscribers","subscription_url":"https://api.github.com/repos/Gizra/negawatt-server/subscription","commits_url":"https://api.github.com/repos/Gizra/negawatt-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/Gizra/negawatt-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/Gizra/negawatt-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/Gizra/negawatt-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/Gizra/negawatt-server/contents/{+path}","compare_url":"https://api.github.com/repos/Gizra/negawatt-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Gizra/negawatt-server/merges","archive_url":"https://api.github.com/repos/Gizra/negawatt-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Gizra/negawatt-server/downloads","issues_url":"https://api.github.com/repos/Gizra/negawatt-server/issues{/number}","pulls_url":"https://api.github.com/repos/Gizra/negawatt-server/pulls{/number}","milestones_url":"https://api.github.com/repos/Gizra/negawatt-server/milestones{/number}","notifications_url":"https://api.github.com/repos/Gizra/negawatt-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Gizra/negawatt-server/labels{/name}","releases_url":"https://api.github.com/repos/Gizra/negawatt-server/releases{/id}","created_at":"2014-09-14T07:40:46Z","updated_at":"2015-04-28T12:48:54Z","pushed_at":"2015-04-29T07:53:35Z","git_url":"git://github.com/Gizra/negawatt-server.git","ssh_url":"git@github.com:Gizra/negawatt-server.git","clone_url":"https://github.com/Gizra/negawatt-server.git","svn_url":"https://github.com/Gizra/negawatt-server","homepage":"http://negawatt-dev.gizra.com","size":36438,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":62,"forks":1,"open_issues":62,"watchers":0,"default_branch":"master"}},"base":{"label":"Gizra:master","ref":"master","sha":"d98cca55e4e7c647caac6ea321f9535b9040e543","user":{"login":"Gizra","id":2484795,"avatar_url":"https://avatars.githubusercontent.com/u/2484795?v=3","gravatar_id":"","url":"https://api.github.com/users/Gizra","html_url":"https://github.com/Gizra","followers_url":"https://api.github.com/users/Gizra/followers","following_url":"https://api.github.com/users/Gizra/following{/other_user}","gists_url":"https://api.github.com/users/Gizra/gists{/gist_id}","starred_url":"https://api.github.com/users/Gizra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gizra/subscriptions","organizations_url":"https://api.github.com/users/Gizra/orgs","repos_url":"https://api.github.com/users/Gizra/repos","events_url":"https://api.github.com/users/Gizra/events{/privacy}","received_events_url":"https://api.github.com/users/Gizra/received_events","type":"Organization","site_admin":false},"repo":{"id":24016302,"name":"negawatt-server","full_name":"Gizra/negawatt-server","owner":{"login":"Gizra","id":2484795,"avatar_url":"https://avatars.githubusercontent.com/u/2484795?v=3","gravatar_id":"","url":"https://api.github.com/users/Gizra","html_url":"https://github.com/Gizra","followers_url":"https://api.github.com/users/Gizra/followers","following_url":"https://api.github.com/users/Gizra/following{/other_user}","gists_url":"https://api.github.com/users/Gizra/gists{/gist_id}","starred_url":"https://api.github.com/users/Gizra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gizra/subscriptions","organizations_url":"https://api.github.com/users/Gizra/orgs","repos_url":"https://api.github.com/users/Gizra/repos","events_url":"https://api.github.com/users/Gizra/events{/privacy}","received_events_url":"https://api.github.com/users/Gizra/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Gizra/negawatt-server","description":"negawatt data server","fork":false,"url":"https://api.github.com/repos/Gizra/negawatt-server","forks_url":"https://api.github.com/repos/Gizra/negawatt-server/forks","keys_url":"https://api.github.com/repos/Gizra/negawatt-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Gizra/negawatt-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Gizra/negawatt-server/teams","hooks_url":"https://api.github.com/repos/Gizra/negawatt-server/hooks","issue_events_url":"https://api.github.com/repos/Gizra/negawatt-server/issues/events{/number}","events_url":"https://api.github.com/repos/Gizra/negawatt-server/events","assignees_url":"https://api.github.com/repos/Gizra/negawatt-server/assignees{/user}","branches_url":"https://api.github.com/repos/Gizra/negawatt-server/branches{/branch}","tags_url":"https://api.github.com/repos/Gizra/negawatt-server/tags","blobs_url":"https://api.github.com/repos/Gizra/negawatt-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Gizra/negawatt-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Gizra/negawatt-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/Gizra/negawatt-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Gizra/negawatt-server/statuses/{sha}","languages_url":"https://api.github.com/repos/Gizra/negawatt-server/languages","stargazers_url":"https://api.github.com/repos/Gizra/negawatt-server/stargazers","contributors_url":"https://api.github.com/repos/Gizra/negawatt-server/contributors","subscribers_url":"https://api.github.com/repos/Gizra/negawatt-server/subscribers","subscription_url":"https://api.github.com/repos/Gizra/negawatt-server/subscription","commits_url":"https://api.github.com/repos/Gizra/negawatt-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/Gizra/negawatt-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/Gizra/negawatt-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/Gizra/negawatt-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/Gizra/negawatt-server/contents/{+path}","compare_url":"https://api.github.com/repos/Gizra/negawatt-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Gizra/negawatt-server/merges","archive_url":"https://api.github.com/repos/Gizra/negawatt-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Gizra/negawatt-server/downloads","issues_url":"https://api.github.com/repos/Gizra/negawatt-server/issues{/number}","pulls_url":"https://api.github.com/repos/Gizra/negawatt-server/pulls{/number}","milestones_url":"https://api.github.com/repos/Gizra/negawatt-server/milestones{/number}","notifications_url":"https://api.github.com/repos/Gizra/negawatt-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Gizra/negawatt-server/labels{/name}","releases_url":"https://api.github.com/repos/Gizra/negawatt-server/releases{/id}","created_at":"2014-09-14T07:40:46Z","updated_at":"2015-04-28T12:48:54Z","pushed_at":"2015-04-29T07:53:35Z","git_url":"git://github.com/Gizra/negawatt-server.git","ssh_url":"git@github.com:Gizra/negawatt-server.git","clone_url":"https://github.com/Gizra/negawatt-server.git","svn_url":"https://github.com/Gizra/negawatt-server","homepage":"http://negawatt-dev.gizra.com","size":36438,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":62,"forks":1,"open_issues":62,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Gizra/negawatt-server/pulls/466"},"html":{"href":"https://github.com/Gizra/negawatt-server/pull/466"},"issue":{"href":"https://api.github.com/repos/Gizra/negawatt-server/issues/466"},"comments":{"href":"https://api.github.com/repos/Gizra/negawatt-server/issues/466/comments"},"review_comments":{"href":"https://api.github.com/repos/Gizra/negawatt-server/pulls/466/comments"},"review_comment":{"href":"https://api.github.com/repos/Gizra/negawatt-server/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Gizra/negawatt-server/pulls/466/commits"},"statuses":{"href":"https://api.github.com/repos/Gizra/negawatt-server/statuses/f5e7167b061be88ee88a7a95dab41675a65f3b10"}}}}