{"action":"created","comment":{"url":"https://api.github.com/repos/capacity4dev/capacity4more/pulls/comments/166651915","pull_request_review_id":94749011,"id":166651915,"diff_hunk":"@@ -0,0 +1,137 @@\n+<?php\n+\n+/**\n+ * @file\n+ * Value object that stores Message Digest preferences.\n+ */\n+\n+/**\n+ * Value object that stores Message Digest preferences.\n+ */\n+final class C4mMessagePreference {\n+\n+  /**\n+   * Flag ID.\n+   *\n+   * @var int\n+   */\n+  private $fid;\n+\n+  /**\n+   * Entity type.\n+   *\n+   * @var string\n+   */\n+  private $entityType;\n+\n+  /**\n+   * Entity ID.\n+   *\n+   * @var int\n+   */\n+  private $entityId;\n+\n+  /**\n+   * User ID.\n+   *\n+   * @var int\n+   */\n+  private $uid;\n+\n+  /**\n+   * Machine name of the digest preference.\n+   *\n+   * @var string\n+   */\n+  private $preference;\n+\n+  /**\n+   * C4mMessagePreference constructor.\n+   *\n+   * @param int $fid\n+   *   Flag ID.\n+   * @param string $entity_type\n+   *   Entity type.\n+   * @param int $entity_id\n+   *   Entity ID.\n+   * @param int $uid\n+   *   User ID.\n+   * @param string $preference\n+   *   Machine name of the digest preference.\n+   */\n+  public function __construct($fid, $entity_type, $entity_id, $uid, $preference) {\n+    if ($fid <= 0 || $entity_id <= 0 || $uid <= 0) {\n+      throw new InvalidArgumentException(\"ID's cannot be less then 0\");\n+    }\n+\n+    $this->fid = $fid;\n+    $this->entityType = $entity_type;\n+    $this->entityId = $entity_id;\n+    $this->uid = $uid;\n+    $this->preference = $preference;\n+  }\n+\n+  /**\n+   * Get the flag ID.\n+   *\n+   * @return int\n+   *   Flag ID.\n+   */\n+  public function getFid() {\n+    return $this->fid;\n+  }\n+\n+  /**\n+   * Get the Entity type.\n+   *\n+   * @return string\n+   *   Entity type.\n+   */\n+  public function getEntityType() {\n+    return $this->entityType;\n+  }\n+\n+  /**\n+   * Get the Entity ID.\n+   *\n+   * @return int\n+   *   Entity ID.\n+   */\n+  public function getEntityId() {\n+    return $this->entityId;\n+  }\n+\n+  /**\n+   * Get the user ID.\n+   *\n+   * @return int\n+   *   User ID.\n+   */\n+  public function getUid() {\n+    return $this->uid;\n+  }\n+\n+  /**\n+   * Get the machine name of the digest preference.\n+   *\n+   * @return string\n+   *   Digest interval preference.\n+   */\n+  public function getPreference() {\n+    return $this->preference;\n+  }\n+\n+  /**\n+   * Update the preference and return a new value object.\n+   *\n+   * @param string $preference\n+   *   The machine name of the (new) digest preference.\n+   *\n+   * @return \\C4mMessagePreference\n+   *   New instance of the value object.\n+   */\n+  public function updatePreference($preference) {\n+    return new C4mMessagePreference($this->fid, $this->entityType, $this->entityId, $this->uid, $preference);","path":"project/profiles/capacity4more/modules/c4m/message/c4m_message_digest/includes/c4m_message_digest_preferences.inc","position":134,"original_position":134,"commit_id":"5a851fc7a64a98e050e7055810361620a5e71f0a","original_commit_id":"80d461add31cc57c6eb89e92c58de74359303d54","user":{"login":"soniCaH","id":789034,"avatar_url":"https://avatars3.githubusercontent.com/u/789034?v=4","gravatar_id":"","url":"https://api.github.com/users/soniCaH","html_url":"https://github.com/soniCaH","followers_url":"https://api.github.com/users/soniCaH/followers","following_url":"https://api.github.com/users/soniCaH/following{/other_user}","gists_url":"https://api.github.com/users/soniCaH/gists{/gist_id}","starred_url":"https://api.github.com/users/soniCaH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soniCaH/subscriptions","organizations_url":"https://api.github.com/users/soniCaH/orgs","repos_url":"https://api.github.com/users/soniCaH/repos","events_url":"https://api.github.com/users/soniCaH/events{/privacy}","received_events_url":"https://api.github.com/users/soniCaH/received_events","type":"User","site_admin":false},"body":"The object is immutable (value object). Putting in practice some best practices from DDD.","created_at":"2018-02-07T15:26:30Z","updated_at":"2018-02-07T15:26:30Z","html_url":"https://github.com/capacity4dev/capacity4more/pull/1819#discussion_r166651915","pull_request_url":"https://api.github.com/repos/capacity4dev/capacity4more/pulls/1819","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/capacity4dev/capacity4more/pulls/comments/166651915"},"html":{"href":"https://github.com/capacity4dev/capacity4more/pull/1819#discussion_r166651915"},"pull_request":{"href":"https://api.github.com/repos/capacity4dev/capacity4more/pulls/1819"}},"in_reply_to_id":166646803},"pull_request":{"url":"https://api.github.com/repos/capacity4dev/capacity4more/pulls/1819","id":166761528,"html_url":"https://github.com/capacity4dev/capacity4more/pull/1819","diff_url":"https://github.com/capacity4dev/capacity4more/pull/1819.diff","patch_url":"https://github.com/capacity4dev/capacity4more/pull/1819.patch","issue_url":"https://api.github.com/repos/capacity4dev/capacity4more/issues/1819","number":1819,"state":"open","locked":false,"title":"WIP: CFDRMD-64: Create message digest with user interface.","user":{"login":"soniCaH","id":789034,"avatar_url":"https://avatars3.githubusercontent.com/u/789034?v=4","gravatar_id":"","url":"https://api.github.com/users/soniCaH","html_url":"https://github.com/soniCaH","followers_url":"https://api.github.com/users/soniCaH/followers","following_url":"https://api.github.com/users/soniCaH/following{/other_user}","gists_url":"https://api.github.com/users/soniCaH/gists{/gist_id}","starred_url":"https://api.github.com/users/soniCaH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soniCaH/subscriptions","organizations_url":"https://api.github.com/users/soniCaH/orgs","repos_url":"https://api.github.com/users/soniCaH/repos","events_url":"https://api.github.com/users/soniCaH/events{/privacy}","received_events_url":"https://api.github.com/users/soniCaH/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-02-02T10:04:08Z","updated_at":"2018-02-07T15:26:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f51e14df691ea37650205d1e13ca868abbf7d447","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"milestone":null,"commits_url":"https://api.github.com/repos/capacity4dev/capacity4more/pulls/1819/commits","review_comments_url":"https://api.github.com/repos/capacity4dev/capacity4more/pulls/1819/comments","review_comment_url":"https://api.github.com/repos/capacity4dev/capacity4more/pulls/comments{/number}","comments_url":"https://api.github.com/repos/capacity4dev/capacity4more/issues/1819/comments","statuses_url":"https://api.github.com/repos/capacity4dev/capacity4more/statuses/5a851fc7a64a98e050e7055810361620a5e71f0a","head":{"label":"capacity4dev:feature/CFDRMD-64-User-Interface","ref":"feature/CFDRMD-64-User-Interface","sha":"5a851fc7a64a98e050e7055810361620a5e71f0a","user":{"login":"capacity4dev","id":6919578,"avatar_url":"https://avatars0.githubusercontent.com/u/6919578?v=4","gravatar_id":"","url":"https://api.github.com/users/capacity4dev","html_url":"https://github.com/capacity4dev","followers_url":"https://api.github.com/users/capacity4dev/followers","following_url":"https://api.github.com/users/capacity4dev/following{/other_user}","gists_url":"https://api.github.com/users/capacity4dev/gists{/gist_id}","starred_url":"https://api.github.com/users/capacity4dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/capacity4dev/subscriptions","organizations_url":"https://api.github.com/users/capacity4dev/orgs","repos_url":"https://api.github.com/users/capacity4dev/repos","events_url":"https://api.github.com/users/capacity4dev/events{/privacy}","received_events_url":"https://api.github.com/users/capacity4dev/received_events","type":"Organization","site_admin":false},"repo":{"id":18283391,"name":"capacity4more","full_name":"capacity4dev/capacity4more","owner":{"login":"capacity4dev","id":6919578,"avatar_url":"https://avatars0.githubusercontent.com/u/6919578?v=4","gravatar_id":"","url":"https://api.github.com/users/capacity4dev","html_url":"https://github.com/capacity4dev","followers_url":"https://api.github.com/users/capacity4dev/followers","following_url":"https://api.github.com/users/capacity4dev/following{/other_user}","gists_url":"https://api.github.com/users/capacity4dev/gists{/gist_id}","starred_url":"https://api.github.com/users/capacity4dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/capacity4dev/subscriptions","organizations_url":"https://api.github.com/users/capacity4dev/orgs","repos_url":"https://api.github.com/users/capacity4dev/repos","events_url":"https://api.github.com/users/capacity4dev/events{/privacy}","received_events_url":"https://api.github.com/users/capacity4dev/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/capacity4dev/capacity4more","description":"A Drupal 7 powered distribution providing a community platform to share knowledge.","fork":false,"url":"https://api.github.com/repos/capacity4dev/capacity4more","forks_url":"https://api.github.com/repos/capacity4dev/capacity4more/forks","keys_url":"https://api.github.com/repos/capacity4dev/capacity4more/keys{/key_id}","collaborators_url":"https://api.github.com/repos/capacity4dev/capacity4more/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/capacity4dev/capacity4more/teams","hooks_url":"https://api.github.com/repos/capacity4dev/capacity4more/hooks","issue_events_url":"https://api.github.com/repos/capacity4dev/capacity4more/issues/events{/number}","events_url":"https://api.github.com/repos/capacity4dev/capacity4more/events","assignees_url":"https://api.github.com/repos/capacity4dev/capacity4more/assignees{/user}","branches_url":"https://api.github.com/repos/capacity4dev/capacity4more/branches{/branch}","tags_url":"https://api.github.com/repos/capacity4dev/capacity4more/tags","blobs_url":"https://api.github.com/repos/capacity4dev/capacity4more/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/capacity4dev/capacity4more/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/capacity4dev/capacity4more/git/refs{/sha}","trees_url":"https://api.github.com/repos/capacity4dev/capacity4more/git/trees{/sha}","statuses_url":"https://api.github.com/repos/capacity4dev/capacity4more/statuses/{sha}","languages_url":"https://api.github.com/repos/capacity4dev/capacity4more/languages","stargazers_url":"https://api.github.com/repos/capacity4dev/capacity4more/stargazers","contributors_url":"https://api.github.com/repos/capacity4dev/capacity4more/contributors","subscribers_url":"https://api.github.com/repos/capacity4dev/capacity4more/subscribers","subscription_url":"https://api.github.com/repos/capacity4dev/capacity4more/subscription","commits_url":"https://api.github.com/repos/capacity4dev/capacity4more/commits{/sha}","git_commits_url":"https://api.github.com/repos/capacity4dev/capacity4more/git/commits{/sha}","comments_url":"https://api.github.com/repos/capacity4dev/capacity4more/comments{/number}","issue_comment_url":"https://api.github.com/repos/capacity4dev/capacity4more/issues/comments{/number}","contents_url":"https://api.github.com/repos/capacity4dev/capacity4more/contents/{+path}","compare_url":"https://api.github.com/repos/capacity4dev/capacity4more/compare/{base}...{head}","merges_url":"https://api.github.com/repos/capacity4dev/capacity4more/merges","archive_url":"https://api.github.com/repos/capacity4dev/capacity4more/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/capacity4dev/capacity4more/downloads","issues_url":"https://api.github.com/repos/capacity4dev/capacity4more/issues{/number}","pulls_url":"https://api.github.com/repos/capacity4dev/capacity4more/pulls{/number}","milestones_url":"https://api.github.com/repos/capacity4dev/capacity4more/milestones{/number}","notifications_url":"https://api.github.com/repos/capacity4dev/capacity4more/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/capacity4dev/capacity4more/labels{/name}","releases_url":"https://api.github.com/repos/capacity4dev/capacity4more/releases{/id}","deployments_url":"https://api.github.com/repos/capacity4dev/capacity4more/deployments","created_at":"2014-03-31T06:03:43Z","updated_at":"2017-07-18T13:22:38Z","pushed_at":"2018-02-07T13:30:27Z","git_url":"git://github.com/capacity4dev/capacity4more.git","ssh_url":"git@github.com:capacity4dev/capacity4more.git","clone_url":"https://github.com/capacity4dev/capacity4more.git","svn_url":"https://github.com/capacity4dev/capacity4more","homepage":null,"size":106433,"stargazers_count":9,"watchers_count":9,"language":"PHP","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":7,"mirror_url":null,"archived":false,"open_issues_count":10,"license":null,"forks":7,"open_issues":10,"watchers":9,"default_branch":"develop"}},"base":{"label":"capacity4dev:develop-php7.1","ref":"develop-php7.1","sha":"7a3e1adeafe4869a57241cdfb4124a92e6f03687","user":{"login":"capacity4dev","id":6919578,"avatar_url":"https://avatars0.githubusercontent.com/u/6919578?v=4","gravatar_id":"","url":"https://api.github.com/users/capacity4dev","html_url":"https://github.com/capacity4dev","followers_url":"https://api.github.com/users/capacity4dev/followers","following_url":"https://api.github.com/users/capacity4dev/following{/other_user}","gists_url":"https://api.github.com/users/capacity4dev/gists{/gist_id}","starred_url":"https://api.github.com/users/capacity4dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/capacity4dev/subscriptions","organizations_url":"https://api.github.com/users/capacity4dev/orgs","repos_url":"https://api.github.com/users/capacity4dev/repos","events_url":"https://api.github.com/users/capacity4dev/events{/privacy}","received_events_url":"https://api.github.com/users/capacity4dev/received_events","type":"Organization","site_admin":false},"repo":{"id":18283391,"name":"capacity4more","full_name":"capacity4dev/capacity4more","owner":{"login":"capacity4dev","id":6919578,"avatar_url":"https://avatars0.githubusercontent.com/u/6919578?v=4","gravatar_id":"","url":"https://api.github.com/users/capacity4dev","html_url":"https://github.com/capacity4dev","followers_url":"https://api.github.com/users/capacity4dev/followers","following_url":"https://api.github.com/users/capacity4dev/following{/other_user}","gists_url":"https://api.github.com/users/capacity4dev/gists{/gist_id}","starred_url":"https://api.github.com/users/capacity4dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/capacity4dev/subscriptions","organizations_url":"https://api.github.com/users/capacity4dev/orgs","repos_url":"https://api.github.com/users/capacity4dev/repos","events_url":"https://api.github.com/users/capacity4dev/events{/privacy}","received_events_url":"https://api.github.com/users/capacity4dev/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/capacity4dev/capacity4more","description":"A Drupal 7 powered distribution providing a community platform to share knowledge.","fork":false,"url":"https://api.github.com/repos/capacity4dev/capacity4more","forks_url":"https://api.github.com/repos/capacity4dev/capacity4more/forks","keys_url":"https://api.github.com/repos/capacity4dev/capacity4more/keys{/key_id}","collaborators_url":"https://api.github.com/repos/capacity4dev/capacity4more/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/capacity4dev/capacity4more/teams","hooks_url":"https://api.github.com/repos/capacity4dev/capacity4more/hooks","issue_events_url":"https://api.github.com/repos/capacity4dev/capacity4more/issues/events{/number}","events_url":"https://api.github.com/repos/capacity4dev/capacity4more/events","assignees_url":"https://api.github.com/repos/capacity4dev/capacity4more/assignees{/user}","branches_url":"https://api.github.com/repos/capacity4dev/capacity4more/branches{/branch}","tags_url":"https://api.github.com/repos/capacity4dev/capacity4more/tags","blobs_url":"https://api.github.com/repos/capacity4dev/capacity4more/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/capacity4dev/capacity4more/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/capacity4dev/capacity4more/git/refs{/sha}","trees_url":"https://api.github.com/repos/capacity4dev/capacity4more/git/trees{/sha}","statuses_url":"https://api.github.com/repos/capacity4dev/capacity4more/statuses/{sha}","languages_url":"https://api.github.com/repos/capacity4dev/capacity4more/languages","stargazers_url":"https://api.github.com/repos/capacity4dev/capacity4more/stargazers","contributors_url":"https://api.github.com/repos/capacity4dev/capacity4more/contributors","subscribers_url":"https://api.github.com/repos/capacity4dev/capacity4more/subscribers","subscription_url":"https://api.github.com/repos/capacity4dev/capacity4more/subscription","commits_url":"https://api.github.com/repos/capacity4dev/capacity4more/commits{/sha}","git_commits_url":"https://api.github.com/repos/capacity4dev/capacity4more/git/commits{/sha}","comments_url":"https://api.github.com/repos/capacity4dev/capacity4more/comments{/number}","issue_comment_url":"https://api.github.com/repos/capacity4dev/capacity4more/issues/comments{/number}","contents_url":"https://api.github.com/repos/capacity4dev/capacity4more/contents/{+path}","compare_url":"https://api.github.com/repos/capacity4dev/capacity4more/compare/{base}...{head}","merges_url":"https://api.github.com/repos/capacity4dev/capacity4more/merges","archive_url":"https://api.github.com/repos/capacity4dev/capacity4more/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/capacity4dev/capacity4more/downloads","issues_url":"https://api.github.com/repos/capacity4dev/capacity4more/issues{/number}","pulls_url":"https://api.github.com/repos/capacity4dev/capacity4more/pulls{/number}","milestones_url":"https://api.github.com/repos/capacity4dev/capacity4more/milestones{/number}","notifications_url":"https://api.github.com/repos/capacity4dev/capacity4more/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/capacity4dev/capacity4more/labels{/name}","releases_url":"https://api.github.com/repos/capacity4dev/capacity4more/releases{/id}","deployments_url":"https://api.github.com/repos/capacity4dev/capacity4more/deployments","created_at":"2014-03-31T06:03:43Z","updated_at":"2017-07-18T13:22:38Z","pushed_at":"2018-02-07T13:30:27Z","git_url":"git://github.com/capacity4dev/capacity4more.git","ssh_url":"git@github.com:capacity4dev/capacity4more.git","clone_url":"https://github.com/capacity4dev/capacity4more.git","svn_url":"https://github.com/capacity4dev/capacity4more","homepage":null,"size":106433,"stargazers_count":9,"watchers_count":9,"language":"PHP","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":7,"mirror_url":null,"archived":false,"open_issues_count":10,"license":null,"forks":7,"open_issues":10,"watchers":9,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/capacity4dev/capacity4more/pulls/1819"},"html":{"href":"https://github.com/capacity4dev/capacity4more/pull/1819"},"issue":{"href":"https://api.github.com/repos/capacity4dev/capacity4more/issues/1819"},"comments":{"href":"https://api.github.com/repos/capacity4dev/capacity4more/issues/1819/comments"},"review_comments":{"href":"https://api.github.com/repos/capacity4dev/capacity4more/pulls/1819/comments"},"review_comment":{"href":"https://api.github.com/repos/capacity4dev/capacity4more/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/capacity4dev/capacity4more/pulls/1819/commits"},"statuses":{"href":"https://api.github.com/repos/capacity4dev/capacity4more/statuses/5a851fc7a64a98e050e7055810361620a5e71f0a"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"soniCaH"}}