{"action":"created","comment":{"url":"https://api.github.com/repos/maragatchalian/Board/pulls/comments/26100004","id":26100004,"diff_hunk":"@@ -0,0 +1,108 @@\n+<?php\n+class ThreadController extends AppController {\n+    \n+/*Create a new comment (Thread)\n+* :: - STATIC FUNCTION, can be called from the class name\n+* -> - INSTANCE, can only be called from an instance of the class.\n+*/\n+public function create(){\n+\n+        $thread = new Thread();\n+        $comment = new Comment();\n+        $page = Param::get('page_next', 'create');\n+        \n+        switch ($page) {\n+           case 'create':\n+           break;\n+          \n+           case 'create_end':\n+            $thread->title = Param::get('title');\n+            $comment->username = Param::get('username');\n+            $comment->body = Param::get('body');\n+ \n+           try {\n+               $thread->create($comment);\n+               } catch (ValidationException $e) {\n+               $page = 'create';\n+            }\n+           break;\n+           \n+           default:\n+            throw new NotFoundException(\"{$page} is not found\");\n+            break;\n+         }  \n+\n+       $this->set(get_defined_vars());\n+       $this->render($page);\n+    }\n+ \n+\n+//Instance of the Thread model, and its static functions getAll()\n+public function index() {\n+    $per_page = 7;\n+    $page = Param::get('page', 1);\n+    $pagination = new SimplePagination($page, $per_page) ;\n+\n+    $threads = Thread::getAll($pagination->start_index -1, $pagination->count + 1);\n+    $pagination->checkLastPage($threads);\n+\n+    $total = Thread::CountAll();","path":"board/app/controllers/thread_controller.php","position":54,"original_position":49,"commit_id":"d609e14ee6656e887a2169db8dd89b77d16d5961","original_commit_id":"58418bf6b00e75a5d640377224024c82056f2afb","user":{"login":"maragatchalian","id":10491936,"avatar_url":"https://avatars.githubusercontent.com/u/10491936?v=3","gravatar_id":"","url":"https://api.github.com/users/maragatchalian","html_url":"https://github.com/maragatchalian","followers_url":"https://api.github.com/users/maragatchalian/followers","following_url":"https://api.github.com/users/maragatchalian/following{/other_user}","gists_url":"https://api.github.com/users/maragatchalian/gists{/gist_id}","starred_url":"https://api.github.com/users/maragatchalian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maragatchalian/subscriptions","organizations_url":"https://api.github.com/users/maragatchalian/orgs","repos_url":"https://api.github.com/users/maragatchalian/repos","events_url":"https://api.github.com/users/maragatchalian/events{/privacy}","received_events_url":"https://api.github.com/users/maragatchalian/received_events","type":"User","site_admin":false},"body":"noted po :bow:","created_at":"2015-03-10T05:42:08Z","updated_at":"2015-03-10T05:42:08Z","html_url":"https://github.com/maragatchalian/Board/pull/1#discussion_r26100004","pull_request_url":"https://api.github.com/repos/maragatchalian/Board/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/maragatchalian/Board/pulls/comments/26100004"},"html":{"href":"https://github.com/maragatchalian/Board/pull/1#discussion_r26100004"},"pull_request":{"href":"https://api.github.com/repos/maragatchalian/Board/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/maragatchalian/Board/pulls/1","id":30263382,"html_url":"https://github.com/maragatchalian/Board/pull/1","diff_url":"https://github.com/maragatchalian/Board/pull/1.diff","patch_url":"https://github.com/maragatchalian/Board/pull/1.patch","issue_url":"https://api.github.com/repos/maragatchalian/Board/issues/1","number":1,"state":"open","locked":false,"title":"dev_1.0","user":{"login":"maragatchalian","id":10491936,"avatar_url":"https://avatars.githubusercontent.com/u/10491936?v=3","gravatar_id":"","url":"https://api.github.com/users/maragatchalian","html_url":"https://github.com/maragatchalian","followers_url":"https://api.github.com/users/maragatchalian/followers","following_url":"https://api.github.com/users/maragatchalian/following{/other_user}","gists_url":"https://api.github.com/users/maragatchalian/gists{/gist_id}","starred_url":"https://api.github.com/users/maragatchalian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maragatchalian/subscriptions","organizations_url":"https://api.github.com/users/maragatchalian/orgs","repos_url":"https://api.github.com/users/maragatchalian/repos","events_url":"https://api.github.com/users/maragatchalian/events{/privacy}","received_events_url":"https://api.github.com/users/maragatchalian/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-03-02T07:31:57Z","updated_at":"2015-03-10T05:42:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"217eee9d9a43c4771dd2332ff4a1f3dcb8bbeaf2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/maragatchalian/Board/pulls/1/commits","review_comments_url":"https://api.github.com/repos/maragatchalian/Board/pulls/1/comments","review_comment_url":"https://api.github.com/repos/maragatchalian/Board/pulls/comments{/number}","comments_url":"https://api.github.com/repos/maragatchalian/Board/issues/1/comments","statuses_url":"https://api.github.com/repos/maragatchalian/Board/statuses/d609e14ee6656e887a2169db8dd89b77d16d5961","head":{"label":"maragatchalian:dev_1.0","ref":"dev_1.0","sha":"d609e14ee6656e887a2169db8dd89b77d16d5961","user":{"login":"maragatchalian","id":10491936,"avatar_url":"https://avatars.githubusercontent.com/u/10491936?v=3","gravatar_id":"","url":"https://api.github.com/users/maragatchalian","html_url":"https://github.com/maragatchalian","followers_url":"https://api.github.com/users/maragatchalian/followers","following_url":"https://api.github.com/users/maragatchalian/following{/other_user}","gists_url":"https://api.github.com/users/maragatchalian/gists{/gist_id}","starred_url":"https://api.github.com/users/maragatchalian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maragatchalian/subscriptions","organizations_url":"https://api.github.com/users/maragatchalian/orgs","repos_url":"https://api.github.com/users/maragatchalian/repos","events_url":"https://api.github.com/users/maragatchalian/events{/privacy}","received_events_url":"https://api.github.com/users/maragatchalian/received_events","type":"User","site_admin":false},"repo":{"id":30956881,"name":"Board","full_name":"maragatchalian/Board","owner":{"login":"maragatchalian","id":10491936,"avatar_url":"https://avatars.githubusercontent.com/u/10491936?v=3","gravatar_id":"","url":"https://api.github.com/users/maragatchalian","html_url":"https://github.com/maragatchalian","followers_url":"https://api.github.com/users/maragatchalian/followers","following_url":"https://api.github.com/users/maragatchalian/following{/other_user}","gists_url":"https://api.github.com/users/maragatchalian/gists{/gist_id}","starred_url":"https://api.github.com/users/maragatchalian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maragatchalian/subscriptions","organizations_url":"https://api.github.com/users/maragatchalian/orgs","repos_url":"https://api.github.com/users/maragatchalian/repos","events_url":"https://api.github.com/users/maragatchalian/events{/privacy}","received_events_url":"https://api.github.com/users/maragatchalian/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/maragatchalian/Board","description":"","fork":false,"url":"https://api.github.com/repos/maragatchalian/Board","forks_url":"https://api.github.com/repos/maragatchalian/Board/forks","keys_url":"https://api.github.com/repos/maragatchalian/Board/keys{/key_id}","collaborators_url":"https://api.github.com/repos/maragatchalian/Board/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/maragatchalian/Board/teams","hooks_url":"https://api.github.com/repos/maragatchalian/Board/hooks","issue_events_url":"https://api.github.com/repos/maragatchalian/Board/issues/events{/number}","events_url":"https://api.github.com/repos/maragatchalian/Board/events","assignees_url":"https://api.github.com/repos/maragatchalian/Board/assignees{/user}","branches_url":"https://api.github.com/repos/maragatchalian/Board/branches{/branch}","tags_url":"https://api.github.com/repos/maragatchalian/Board/tags","blobs_url":"https://api.github.com/repos/maragatchalian/Board/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/maragatchalian/Board/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/maragatchalian/Board/git/refs{/sha}","trees_url":"https://api.github.com/repos/maragatchalian/Board/git/trees{/sha}","statuses_url":"https://api.github.com/repos/maragatchalian/Board/statuses/{sha}","languages_url":"https://api.github.com/repos/maragatchalian/Board/languages","stargazers_url":"https://api.github.com/repos/maragatchalian/Board/stargazers","contributors_url":"https://api.github.com/repos/maragatchalian/Board/contributors","subscribers_url":"https://api.github.com/repos/maragatchalian/Board/subscribers","subscription_url":"https://api.github.com/repos/maragatchalian/Board/subscription","commits_url":"https://api.github.com/repos/maragatchalian/Board/commits{/sha}","git_commits_url":"https://api.github.com/repos/maragatchalian/Board/git/commits{/sha}","comments_url":"https://api.github.com/repos/maragatchalian/Board/comments{/number}","issue_comment_url":"https://api.github.com/repos/maragatchalian/Board/issues/comments{/number}","contents_url":"https://api.github.com/repos/maragatchalian/Board/contents/{+path}","compare_url":"https://api.github.com/repos/maragatchalian/Board/compare/{base}...{head}","merges_url":"https://api.github.com/repos/maragatchalian/Board/merges","archive_url":"https://api.github.com/repos/maragatchalian/Board/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/maragatchalian/Board/downloads","issues_url":"https://api.github.com/repos/maragatchalian/Board/issues{/number}","pulls_url":"https://api.github.com/repos/maragatchalian/Board/pulls{/number}","milestones_url":"https://api.github.com/repos/maragatchalian/Board/milestones{/number}","notifications_url":"https://api.github.com/repos/maragatchalian/Board/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/maragatchalian/Board/labels{/name}","releases_url":"https://api.github.com/repos/maragatchalian/Board/releases{/id}","created_at":"2015-02-18T07:57:19Z","updated_at":"2015-03-09T01:54:56Z","pushed_at":"2015-03-09T01:54:56Z","git_url":"git://github.com/maragatchalian/Board.git","ssh_url":"git@github.com:maragatchalian/Board.git","clone_url":"https://github.com/maragatchalian/Board.git","svn_url":"https://github.com/maragatchalian/Board","homepage":null,"size":352,"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":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"dev_1.0"}},"base":{"label":"maragatchalian:master","ref":"master","sha":"4cbac81549f18be04adc43a37cd4cb0f9459162f","user":{"login":"maragatchalian","id":10491936,"avatar_url":"https://avatars.githubusercontent.com/u/10491936?v=3","gravatar_id":"","url":"https://api.github.com/users/maragatchalian","html_url":"https://github.com/maragatchalian","followers_url":"https://api.github.com/users/maragatchalian/followers","following_url":"https://api.github.com/users/maragatchalian/following{/other_user}","gists_url":"https://api.github.com/users/maragatchalian/gists{/gist_id}","starred_url":"https://api.github.com/users/maragatchalian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maragatchalian/subscriptions","organizations_url":"https://api.github.com/users/maragatchalian/orgs","repos_url":"https://api.github.com/users/maragatchalian/repos","events_url":"https://api.github.com/users/maragatchalian/events{/privacy}","received_events_url":"https://api.github.com/users/maragatchalian/received_events","type":"User","site_admin":false},"repo":{"id":30956881,"name":"Board","full_name":"maragatchalian/Board","owner":{"login":"maragatchalian","id":10491936,"avatar_url":"https://avatars.githubusercontent.com/u/10491936?v=3","gravatar_id":"","url":"https://api.github.com/users/maragatchalian","html_url":"https://github.com/maragatchalian","followers_url":"https://api.github.com/users/maragatchalian/followers","following_url":"https://api.github.com/users/maragatchalian/following{/other_user}","gists_url":"https://api.github.com/users/maragatchalian/gists{/gist_id}","starred_url":"https://api.github.com/users/maragatchalian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maragatchalian/subscriptions","organizations_url":"https://api.github.com/users/maragatchalian/orgs","repos_url":"https://api.github.com/users/maragatchalian/repos","events_url":"https://api.github.com/users/maragatchalian/events{/privacy}","received_events_url":"https://api.github.com/users/maragatchalian/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/maragatchalian/Board","description":"","fork":false,"url":"https://api.github.com/repos/maragatchalian/Board","forks_url":"https://api.github.com/repos/maragatchalian/Board/forks","keys_url":"https://api.github.com/repos/maragatchalian/Board/keys{/key_id}","collaborators_url":"https://api.github.com/repos/maragatchalian/Board/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/maragatchalian/Board/teams","hooks_url":"https://api.github.com/repos/maragatchalian/Board/hooks","issue_events_url":"https://api.github.com/repos/maragatchalian/Board/issues/events{/number}","events_url":"https://api.github.com/repos/maragatchalian/Board/events","assignees_url":"https://api.github.com/repos/maragatchalian/Board/assignees{/user}","branches_url":"https://api.github.com/repos/maragatchalian/Board/branches{/branch}","tags_url":"https://api.github.com/repos/maragatchalian/Board/tags","blobs_url":"https://api.github.com/repos/maragatchalian/Board/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/maragatchalian/Board/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/maragatchalian/Board/git/refs{/sha}","trees_url":"https://api.github.com/repos/maragatchalian/Board/git/trees{/sha}","statuses_url":"https://api.github.com/repos/maragatchalian/Board/statuses/{sha}","languages_url":"https://api.github.com/repos/maragatchalian/Board/languages","stargazers_url":"https://api.github.com/repos/maragatchalian/Board/stargazers","contributors_url":"https://api.github.com/repos/maragatchalian/Board/contributors","subscribers_url":"https://api.github.com/repos/maragatchalian/Board/subscribers","subscription_url":"https://api.github.com/repos/maragatchalian/Board/subscription","commits_url":"https://api.github.com/repos/maragatchalian/Board/commits{/sha}","git_commits_url":"https://api.github.com/repos/maragatchalian/Board/git/commits{/sha}","comments_url":"https://api.github.com/repos/maragatchalian/Board/comments{/number}","issue_comment_url":"https://api.github.com/repos/maragatchalian/Board/issues/comments{/number}","contents_url":"https://api.github.com/repos/maragatchalian/Board/contents/{+path}","compare_url":"https://api.github.com/repos/maragatchalian/Board/compare/{base}...{head}","merges_url":"https://api.github.com/repos/maragatchalian/Board/merges","archive_url":"https://api.github.com/repos/maragatchalian/Board/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/maragatchalian/Board/downloads","issues_url":"https://api.github.com/repos/maragatchalian/Board/issues{/number}","pulls_url":"https://api.github.com/repos/maragatchalian/Board/pulls{/number}","milestones_url":"https://api.github.com/repos/maragatchalian/Board/milestones{/number}","notifications_url":"https://api.github.com/repos/maragatchalian/Board/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/maragatchalian/Board/labels{/name}","releases_url":"https://api.github.com/repos/maragatchalian/Board/releases{/id}","created_at":"2015-02-18T07:57:19Z","updated_at":"2015-03-09T01:54:56Z","pushed_at":"2015-03-09T01:54:56Z","git_url":"git://github.com/maragatchalian/Board.git","ssh_url":"git@github.com:maragatchalian/Board.git","clone_url":"https://github.com/maragatchalian/Board.git","svn_url":"https://github.com/maragatchalian/Board","homepage":null,"size":352,"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":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"dev_1.0"}},"_links":{"self":{"href":"https://api.github.com/repos/maragatchalian/Board/pulls/1"},"html":{"href":"https://github.com/maragatchalian/Board/pull/1"},"issue":{"href":"https://api.github.com/repos/maragatchalian/Board/issues/1"},"comments":{"href":"https://api.github.com/repos/maragatchalian/Board/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/maragatchalian/Board/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/maragatchalian/Board/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/maragatchalian/Board/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/maragatchalian/Board/statuses/d609e14ee6656e887a2169db8dd89b77d16d5961"}}}}