{"action":"created","comment":{"url":"https://api.github.com/repos/DBCDK/biblo-admin/pulls/comments/58496471","id":58496471,"diff_hunk":"@@ -208,6 +250,48 @@ public function build() {\n   }\n \n   /**\n+   * Get all quarantined profiles.\n+   *\n+   * @param array $profiles_filter\n+   *   An array containing filter arguments.\n+   *\n+   * @throws \\DBCDK\\CommunityServices\\ApiException\n+   *   Throws API Exception if any of the calls to the services fails.\n+   *\n+   * @return \\DBCDK\\CommunityServices\\Model\\Profile[] $profiles\n+   *   An array of Profile objects with an active quarantine.\n+   */\n+  protected function getQuarantinedProfiles(array $profiles_filter) {\n+    // Fetch all quarantines that are active from the moment of the request.\n+    $quarantined_filter = [\n+      'where' => [\n+        'end' => [\n+          'gt' => date('Y-m-d\\TH:i:s.000\\Z'),\n+        ],\n+      ],\n+    ];\n+    $quarantines = (array) $this->quarantineApi->quarantineFind(json_encode($quarantined_filter));\n+\n+    // Reduce all the quarantines to an array of quarantined profile ids.\n+    // We do this to make sure a profile id only appears once since we use these\n+    // values as \"Where\" arguments for the next request to the service, and a\n+    // profile can have multiple quarantines at the same time.\n+    $quarantine_ids = array_reduce($quarantines, function($result, $quarantine) {\n+      $result[$quarantine->getQuarantinedId()] = ['id' => $quarantine->getQuarantinedId()];","path":"web/modules/custom/dbcdk_community/src/Plugin/Block/ProfilesBlock.php","position":165,"original_position":165,"commit_id":"9ecef7153027e1730e1fbbf65ee7628a82218afc","original_commit_id":"9ecef7153027e1730e1fbbf65ee7628a82218afc","user":{"login":"kasperg","id":73966,"avatar_url":"https://avatars.githubusercontent.com/u/73966?v=3","gravatar_id":"","url":"https://api.github.com/users/kasperg","html_url":"https://github.com/kasperg","followers_url":"https://api.github.com/users/kasperg/followers","following_url":"https://api.github.com/users/kasperg/following{/other_user}","gists_url":"https://api.github.com/users/kasperg/gists{/gist_id}","starred_url":"https://api.github.com/users/kasperg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kasperg/subscriptions","organizations_url":"https://api.github.com/users/kasperg/orgs","repos_url":"https://api.github.com/users/kasperg/repos","events_url":"https://api.github.com/users/kasperg/events{/privacy}","received_events_url":"https://api.github.com/users/kasperg/received_events","type":"User","site_admin":false},"body":"We need to update this according to the latest changes in #48.","created_at":"2016-04-05T07:24:30Z","updated_at":"2016-04-05T07:24:30Z","html_url":"https://github.com/DBCDK/biblo-admin/pull/42#discussion_r58496471","pull_request_url":"https://api.github.com/repos/DBCDK/biblo-admin/pulls/42","_links":{"self":{"href":"https://api.github.com/repos/DBCDK/biblo-admin/pulls/comments/58496471"},"html":{"href":"https://github.com/DBCDK/biblo-admin/pull/42#discussion_r58496471"},"pull_request":{"href":"https://api.github.com/repos/DBCDK/biblo-admin/pulls/42"}}},"pull_request":{"url":"https://api.github.com/repos/DBCDK/biblo-admin/pulls/42","id":65109685,"html_url":"https://github.com/DBCDK/biblo-admin/pull/42","diff_url":"https://github.com/DBCDK/biblo-admin/pull/42.diff","patch_url":"https://github.com/DBCDK/biblo-admin/pull/42.patch","issue_url":"https://api.github.com/repos/DBCDK/biblo-admin/issues/42","number":42,"state":"open","locked":false,"title":"Add the option to filter profiles by quarantines","user":{"login":"kallehauge","id":3846700,"avatar_url":"https://avatars.githubusercontent.com/u/3846700?v=3","gravatar_id":"","url":"https://api.github.com/users/kallehauge","html_url":"https://github.com/kallehauge","followers_url":"https://api.github.com/users/kallehauge/followers","following_url":"https://api.github.com/users/kallehauge/following{/other_user}","gists_url":"https://api.github.com/users/kallehauge/gists{/gist_id}","starred_url":"https://api.github.com/users/kallehauge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kallehauge/subscriptions","organizations_url":"https://api.github.com/users/kallehauge/orgs","repos_url":"https://api.github.com/users/kallehauge/repos","events_url":"https://api.github.com/users/kallehauge/events{/privacy}","received_events_url":"https://api.github.com/users/kallehauge/received_events","type":"User","site_admin":false},"body":"This PR contains:\r\n* A new field in the Profiles Filter form.\r\n* A check in Profiles Block that determines how we should fetch the list of profiles.","created_at":"2016-04-04T08:23:29Z","updated_at":"2016-04-05T07:24:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3009dbbffedf60a6910029530e3b5c4436a5307b","assignee":{"login":"kasperg","id":73966,"avatar_url":"https://avatars.githubusercontent.com/u/73966?v=3","gravatar_id":"","url":"https://api.github.com/users/kasperg","html_url":"https://github.com/kasperg","followers_url":"https://api.github.com/users/kasperg/followers","following_url":"https://api.github.com/users/kasperg/following{/other_user}","gists_url":"https://api.github.com/users/kasperg/gists{/gist_id}","starred_url":"https://api.github.com/users/kasperg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kasperg/subscriptions","organizations_url":"https://api.github.com/users/kasperg/orgs","repos_url":"https://api.github.com/users/kasperg/repos","events_url":"https://api.github.com/users/kasperg/events{/privacy}","received_events_url":"https://api.github.com/users/kasperg/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/DBCDK/biblo-admin/pulls/42/commits","review_comments_url":"https://api.github.com/repos/DBCDK/biblo-admin/pulls/42/comments","review_comment_url":"https://api.github.com/repos/DBCDK/biblo-admin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DBCDK/biblo-admin/issues/42/comments","statuses_url":"https://api.github.com/repos/DBCDK/biblo-admin/statuses/9ecef7153027e1730e1fbbf65ee7628a82218afc","head":{"label":"DBCDK:feature/quarantine-filter","ref":"feature/quarantine-filter","sha":"9ecef7153027e1730e1fbbf65ee7628a82218afc","user":{"login":"DBCDK","id":555633,"avatar_url":"https://avatars.githubusercontent.com/u/555633?v=3","gravatar_id":"","url":"https://api.github.com/users/DBCDK","html_url":"https://github.com/DBCDK","followers_url":"https://api.github.com/users/DBCDK/followers","following_url":"https://api.github.com/users/DBCDK/following{/other_user}","gists_url":"https://api.github.com/users/DBCDK/gists{/gist_id}","starred_url":"https://api.github.com/users/DBCDK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DBCDK/subscriptions","organizations_url":"https://api.github.com/users/DBCDK/orgs","repos_url":"https://api.github.com/users/DBCDK/repos","events_url":"https://api.github.com/users/DBCDK/events{/privacy}","received_events_url":"https://api.github.com/users/DBCDK/received_events","type":"Organization","site_admin":false},"repo":{"id":51740597,"name":"biblo-admin","full_name":"DBCDK/biblo-admin","owner":{"login":"DBCDK","id":555633,"avatar_url":"https://avatars.githubusercontent.com/u/555633?v=3","gravatar_id":"","url":"https://api.github.com/users/DBCDK","html_url":"https://github.com/DBCDK","followers_url":"https://api.github.com/users/DBCDK/followers","following_url":"https://api.github.com/users/DBCDK/following{/other_user}","gists_url":"https://api.github.com/users/DBCDK/gists{/gist_id}","starred_url":"https://api.github.com/users/DBCDK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DBCDK/subscriptions","organizations_url":"https://api.github.com/users/DBCDK/orgs","repos_url":"https://api.github.com/users/DBCDK/repos","events_url":"https://api.github.com/users/DBCDK/events{/privacy}","received_events_url":"https://api.github.com/users/DBCDK/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DBCDK/biblo-admin","description":"Admin application for biblo","fork":false,"url":"https://api.github.com/repos/DBCDK/biblo-admin","forks_url":"https://api.github.com/repos/DBCDK/biblo-admin/forks","keys_url":"https://api.github.com/repos/DBCDK/biblo-admin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DBCDK/biblo-admin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DBCDK/biblo-admin/teams","hooks_url":"https://api.github.com/repos/DBCDK/biblo-admin/hooks","issue_events_url":"https://api.github.com/repos/DBCDK/biblo-admin/issues/events{/number}","events_url":"https://api.github.com/repos/DBCDK/biblo-admin/events","assignees_url":"https://api.github.com/repos/DBCDK/biblo-admin/assignees{/user}","branches_url":"https://api.github.com/repos/DBCDK/biblo-admin/branches{/branch}","tags_url":"https://api.github.com/repos/DBCDK/biblo-admin/tags","blobs_url":"https://api.github.com/repos/DBCDK/biblo-admin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DBCDK/biblo-admin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DBCDK/biblo-admin/git/refs{/sha}","trees_url":"https://api.github.com/repos/DBCDK/biblo-admin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DBCDK/biblo-admin/statuses/{sha}","languages_url":"https://api.github.com/repos/DBCDK/biblo-admin/languages","stargazers_url":"https://api.github.com/repos/DBCDK/biblo-admin/stargazers","contributors_url":"https://api.github.com/repos/DBCDK/biblo-admin/contributors","subscribers_url":"https://api.github.com/repos/DBCDK/biblo-admin/subscribers","subscription_url":"https://api.github.com/repos/DBCDK/biblo-admin/subscription","commits_url":"https://api.github.com/repos/DBCDK/biblo-admin/commits{/sha}","git_commits_url":"https://api.github.com/repos/DBCDK/biblo-admin/git/commits{/sha}","comments_url":"https://api.github.com/repos/DBCDK/biblo-admin/comments{/number}","issue_comment_url":"https://api.github.com/repos/DBCDK/biblo-admin/issues/comments{/number}","contents_url":"https://api.github.com/repos/DBCDK/biblo-admin/contents/{+path}","compare_url":"https://api.github.com/repos/DBCDK/biblo-admin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DBCDK/biblo-admin/merges","archive_url":"https://api.github.com/repos/DBCDK/biblo-admin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DBCDK/biblo-admin/downloads","issues_url":"https://api.github.com/repos/DBCDK/biblo-admin/issues{/number}","pulls_url":"https://api.github.com/repos/DBCDK/biblo-admin/pulls{/number}","milestones_url":"https://api.github.com/repos/DBCDK/biblo-admin/milestones{/number}","notifications_url":"https://api.github.com/repos/DBCDK/biblo-admin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DBCDK/biblo-admin/labels{/name}","releases_url":"https://api.github.com/repos/DBCDK/biblo-admin/releases{/id}","deployments_url":"https://api.github.com/repos/DBCDK/biblo-admin/deployments","created_at":"2016-02-15T08:19:28Z","updated_at":"2016-02-15T12:37:38Z","pushed_at":"2016-04-05T07:13:33Z","git_url":"git://github.com/DBCDK/biblo-admin.git","ssh_url":"git@github.com:DBCDK/biblo-admin.git","clone_url":"https://github.com/DBCDK/biblo-admin.git","svn_url":"https://github.com/DBCDK/biblo-admin","homepage":null,"size":516,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"develop"}},"base":{"label":"DBCDK:develop","ref":"develop","sha":"1719080119cf0bc41597bc3798e4a75327162105","user":{"login":"DBCDK","id":555633,"avatar_url":"https://avatars.githubusercontent.com/u/555633?v=3","gravatar_id":"","url":"https://api.github.com/users/DBCDK","html_url":"https://github.com/DBCDK","followers_url":"https://api.github.com/users/DBCDK/followers","following_url":"https://api.github.com/users/DBCDK/following{/other_user}","gists_url":"https://api.github.com/users/DBCDK/gists{/gist_id}","starred_url":"https://api.github.com/users/DBCDK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DBCDK/subscriptions","organizations_url":"https://api.github.com/users/DBCDK/orgs","repos_url":"https://api.github.com/users/DBCDK/repos","events_url":"https://api.github.com/users/DBCDK/events{/privacy}","received_events_url":"https://api.github.com/users/DBCDK/received_events","type":"Organization","site_admin":false},"repo":{"id":51740597,"name":"biblo-admin","full_name":"DBCDK/biblo-admin","owner":{"login":"DBCDK","id":555633,"avatar_url":"https://avatars.githubusercontent.com/u/555633?v=3","gravatar_id":"","url":"https://api.github.com/users/DBCDK","html_url":"https://github.com/DBCDK","followers_url":"https://api.github.com/users/DBCDK/followers","following_url":"https://api.github.com/users/DBCDK/following{/other_user}","gists_url":"https://api.github.com/users/DBCDK/gists{/gist_id}","starred_url":"https://api.github.com/users/DBCDK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DBCDK/subscriptions","organizations_url":"https://api.github.com/users/DBCDK/orgs","repos_url":"https://api.github.com/users/DBCDK/repos","events_url":"https://api.github.com/users/DBCDK/events{/privacy}","received_events_url":"https://api.github.com/users/DBCDK/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DBCDK/biblo-admin","description":"Admin application for biblo","fork":false,"url":"https://api.github.com/repos/DBCDK/biblo-admin","forks_url":"https://api.github.com/repos/DBCDK/biblo-admin/forks","keys_url":"https://api.github.com/repos/DBCDK/biblo-admin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DBCDK/biblo-admin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DBCDK/biblo-admin/teams","hooks_url":"https://api.github.com/repos/DBCDK/biblo-admin/hooks","issue_events_url":"https://api.github.com/repos/DBCDK/biblo-admin/issues/events{/number}","events_url":"https://api.github.com/repos/DBCDK/biblo-admin/events","assignees_url":"https://api.github.com/repos/DBCDK/biblo-admin/assignees{/user}","branches_url":"https://api.github.com/repos/DBCDK/biblo-admin/branches{/branch}","tags_url":"https://api.github.com/repos/DBCDK/biblo-admin/tags","blobs_url":"https://api.github.com/repos/DBCDK/biblo-admin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DBCDK/biblo-admin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DBCDK/biblo-admin/git/refs{/sha}","trees_url":"https://api.github.com/repos/DBCDK/biblo-admin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DBCDK/biblo-admin/statuses/{sha}","languages_url":"https://api.github.com/repos/DBCDK/biblo-admin/languages","stargazers_url":"https://api.github.com/repos/DBCDK/biblo-admin/stargazers","contributors_url":"https://api.github.com/repos/DBCDK/biblo-admin/contributors","subscribers_url":"https://api.github.com/repos/DBCDK/biblo-admin/subscribers","subscription_url":"https://api.github.com/repos/DBCDK/biblo-admin/subscription","commits_url":"https://api.github.com/repos/DBCDK/biblo-admin/commits{/sha}","git_commits_url":"https://api.github.com/repos/DBCDK/biblo-admin/git/commits{/sha}","comments_url":"https://api.github.com/repos/DBCDK/biblo-admin/comments{/number}","issue_comment_url":"https://api.github.com/repos/DBCDK/biblo-admin/issues/comments{/number}","contents_url":"https://api.github.com/repos/DBCDK/biblo-admin/contents/{+path}","compare_url":"https://api.github.com/repos/DBCDK/biblo-admin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DBCDK/biblo-admin/merges","archive_url":"https://api.github.com/repos/DBCDK/biblo-admin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DBCDK/biblo-admin/downloads","issues_url":"https://api.github.com/repos/DBCDK/biblo-admin/issues{/number}","pulls_url":"https://api.github.com/repos/DBCDK/biblo-admin/pulls{/number}","milestones_url":"https://api.github.com/repos/DBCDK/biblo-admin/milestones{/number}","notifications_url":"https://api.github.com/repos/DBCDK/biblo-admin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DBCDK/biblo-admin/labels{/name}","releases_url":"https://api.github.com/repos/DBCDK/biblo-admin/releases{/id}","deployments_url":"https://api.github.com/repos/DBCDK/biblo-admin/deployments","created_at":"2016-02-15T08:19:28Z","updated_at":"2016-02-15T12:37:38Z","pushed_at":"2016-04-05T07:13:33Z","git_url":"git://github.com/DBCDK/biblo-admin.git","ssh_url":"git@github.com:DBCDK/biblo-admin.git","clone_url":"https://github.com/DBCDK/biblo-admin.git","svn_url":"https://github.com/DBCDK/biblo-admin","homepage":null,"size":516,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/DBCDK/biblo-admin/pulls/42"},"html":{"href":"https://github.com/DBCDK/biblo-admin/pull/42"},"issue":{"href":"https://api.github.com/repos/DBCDK/biblo-admin/issues/42"},"comments":{"href":"https://api.github.com/repos/DBCDK/biblo-admin/issues/42/comments"},"review_comments":{"href":"https://api.github.com/repos/DBCDK/biblo-admin/pulls/42/comments"},"review_comment":{"href":"https://api.github.com/repos/DBCDK/biblo-admin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DBCDK/biblo-admin/pulls/42/commits"},"statuses":{"href":"https://api.github.com/repos/DBCDK/biblo-admin/statuses/9ecef7153027e1730e1fbbf65ee7628a82218afc"}}}}