GitHub PullRequestReviewCommentEvent at 2014-08-22 22:17:44
Repository: pages
Actor: EXreaction
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/phpbb-extensions/pages/pulls/comments/16624321","id":16624321,"diff_hunk":"@@ -0,0 +1,746 @@\n+<?php\n+/**\n+*\n+* Pages extension for the phpBB Forum Software package.\n+*\n+* @copyright (c) 2014 phpBB Limited <https://www.phpbb.com>\n+* @license GNU General Public License, version 2 (GPL-2.0)\n+*\n+*/\n+\n+namespace phpbb\\pages\\entity;\n+\n+/**\n+* Entity for a page\n+*/\n+class page implements page_interface\n+{\n+\t/**\n+\t* Data for this entity\n+\t*\n+\t* @var array\n+\t*\tpage_id\n+\t*\tpage_title\n+\t*\tpage_description\n+\t*\tpage_route\n+\t*\tpage_link_location_id\n+\t*\tpage_order\n+\t*\tpage_content\n+\t*\tpage_content_bbcode_uid\n+\t*\tpage_content_bbcode_bitfield\n+\t*\tpage_content_bbcode_options\n+\t*\tpage_content_allow_html\n+\t*\tpage_display\n+\t*\tpage_display_to_guests\n+\t* @access protected\n+\t*/\n+\tprotected $data;\n+\n+\t/** @var \\phpbb\\db\\driver\\driver_interface */\n+\tprotected $db;\n+\n+\t/**\n+\t* The database table the page data is stored in\n+\t*\n+\t* @var string\n+\t*/\n+\tprotected $pages_table;\n+\n+\t/**\n+\t* Constructor\n+\t*\n+\t* @param \\phpbb\\db\\driver\\driver_interface    $db                 Database object\n+\t* @param string                               $pages_table        Name of the table used to store page data\n+\t* @return null\n+\t* @access public\n+\t*/\n+\tpublic function __construct(\\phpbb\\db\\driver\\driver_interface $db, $pages_table)\n+\t{\n+\t\t$this->db = $db;\n+\t\t$this->pages_table = $pages_table;\n+\t}\n+\n+\t/**\n+\t* Load the data from the database for a page\n+\t*\n+\t* @param int $id Page identifier\n+\t* @param string $route Page route\n+\t* @return page_interface $this object for chaining calls; load()->set()->save()\n+\t* @access public\n+\t* @throws \\phpbb\\pages\\exception\\out_of_bounds\n+\t*/\n+\tpublic function load($id = 0, $route = '')\n+\t{\n+\t\t// Load by page route if provided, otherwise default to load by id\n+\t\t$sql_where = (!empty($route)) ? \" WHERE page_route = '\" . $this->db->sql_escape($route) . \"'\" : ' WHERE page_id = ' . (int) $id;\n+\n+\t\t// Get page from the database\n+\t\t$sql = 'SELECT *\n+\t\t\tFROM ' . $this->pages_table . $sql_where;","path":"entity/page.php","position":79,"original_position":79,"commit_id":"dec75832418845b17e84f40826ac90c0810756ac","original_commit_id":"dec75832418845b17e84f40826ac90c0810756ac","user":{"login":"EXreaction","id":214383,"avatar_url":"https://avatars.githubusercontent.com/u/214383?v=2","gravatar_id":"e6a9c7bc69530add787ed2c9175931cb","url":"https://api.github.com/users/EXreaction","html_url":"https://github.com/EXreaction","followers_url":"https://api.github.com/users/EXreaction/followers","following_url":"https://api.github.com/users/EXreaction/following{/other_user}","gists_url":"https://api.github.com/users/EXreaction/gists{/gist_id}","starred_url":"https://api.github.com/users/EXreaction/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EXreaction/subscriptions","organizations_url":"https://api.github.com/users/EXreaction/orgs","repos_url":"https://api.github.com/users/EXreaction/repos","events_url":"https://api.github.com/users/EXreaction/events{/privacy}","received_events_url":"https://api.github.com/users/EXreaction/received_events","type":"User","site_admin":false},"body":"Personally I'd prefer FROM ... \\n WHERE $sql_where; I think it's a little clearer that this query is not just selecting every row.","created_at":"2014-08-22T22:17:44Z","updated_at":"2014-08-22T22:17:44Z","html_url":"https://github.com/phpbb-extensions/pages/pull/5#discussion_r16624321","pull_request_url":"https://api.github.com/repos/phpbb-extensions/pages/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/phpbb-extensions/pages/pulls/comments/16624321"},"html":{"href":"https://github.com/phpbb-extensions/pages/pull/5#discussion_r16624321"},"pull_request":{"href":"https://api.github.com/repos/phpbb-extensions/pages/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/phpbb-extensions/pages/pulls/5","id":20151542,"html_url":"https://github.com/phpbb-extensions/pages/pull/5","diff_url":"https://github.com/phpbb-extensions/pages/pull/5.diff","patch_url":"https://github.com/phpbb-extensions/pages/pull/5.patch","issue_url":"https://api.github.com/repos/phpbb-extensions/pages/issues/5","number":5,"state":"open","locked":false,"title":"Add entity class and interface","user":{"login":"VSEphpbb","id":303711,"avatar_url":"https://avatars.githubusercontent.com/u/303711?v=2","gravatar_id":"769d13e563bc00594bc5b3307aeb5a4a","url":"https://api.github.com/users/VSEphpbb","html_url":"https://github.com/VSEphpbb","followers_url":"https://api.github.com/users/VSEphpbb/followers","following_url":"https://api.github.com/users/VSEphpbb/following{/other_user}","gists_url":"https://api.github.com/users/VSEphpbb/gists{/gist_id}","starred_url":"https://api.github.com/users/VSEphpbb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VSEphpbb/subscriptions","organizations_url":"https://api.github.com/users/VSEphpbb/orgs","repos_url":"https://api.github.com/users/VSEphpbb/repos","events_url":"https://api.github.com/users/VSEphpbb/events{/privacy}","received_events_url":"https://api.github.com/users/VSEphpbb/received_events","type":"User","site_admin":false},"body":"I can remove tests from the PR if they make it too big, but I think they may help show the entity methods in action.\r\n\r\nThe real focus of scrutiny on this PR really should be in the page class and the migration for the table setup.\r\n\r\n1. Outstanding issue to figure out: How to enforce unique \"route\" names.","created_at":"2014-08-22T03:45:35Z","updated_at":"2014-08-22T22:17:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8bb734e492de215f680b7b4be59f73168060593d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/phpbb-extensions/pages/pulls/5/commits","review_comments_url":"https://api.github.com/repos/phpbb-extensions/pages/pulls/5/comments","review_comment_url":"https://api.github.com/repos/phpbb-extensions/pages/pulls/comments/{number}","comments_url":"https://api.github.com/repos/phpbb-extensions/pages/issues/5/comments","statuses_url":"https://api.github.com/repos/phpbb-extensions/pages/statuses/dec75832418845b17e84f40826ac90c0810756ac","head":{"label":"VSEphpbb:develop-entity","ref":"develop-entity","sha":"dec75832418845b17e84f40826ac90c0810756ac","user":{"login":"VSEphpbb","id":303711,"avatar_url":"https://avatars.githubusercontent.com/u/303711?v=2","gravatar_id":"769d13e563bc00594bc5b3307aeb5a4a","url":"https://api.github.com/users/VSEphpbb","html_url":"https://github.com/VSEphpbb","followers_url":"https://api.github.com/users/VSEphpbb/followers","following_url":"https://api.github.com/users/VSEphpbb/following{/other_user}","gists_url":"https://api.github.com/users/VSEphpbb/gists{/gist_id}","starred_url":"https://api.github.com/users/VSEphpbb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VSEphpbb/subscriptions","organizations_url":"https://api.github.com/users/VSEphpbb/orgs","repos_url":"https://api.github.com/users/VSEphpbb/repos","events_url":"https://api.github.com/users/VSEphpbb/events{/privacy}","received_events_url":"https://api.github.com/users/VSEphpbb/received_events","type":"User","site_admin":false},"repo":{"id":23078764,"name":"pages","full_name":"VSEphpbb/pages","owner":{"login":"VSEphpbb","id":303711,"avatar_url":"https://avatars.githubusercontent.com/u/303711?v=2","gravatar_id":"769d13e563bc00594bc5b3307aeb5a4a","url":"https://api.github.com/users/VSEphpbb","html_url":"https://github.com/VSEphpbb","followers_url":"https://api.github.com/users/VSEphpbb/followers","following_url":"https://api.github.com/users/VSEphpbb/following{/other_user}","gists_url":"https://api.github.com/users/VSEphpbb/gists{/gist_id}","starred_url":"https://api.github.com/users/VSEphpbb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VSEphpbb/subscriptions","organizations_url":"https://api.github.com/users/VSEphpbb/orgs","repos_url":"https://api.github.com/users/VSEphpbb/repos","events_url":"https://api.github.com/users/VSEphpbb/events{/privacy}","received_events_url":"https://api.github.com/users/VSEphpbb/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/VSEphpbb/pages","description":"This is the repository for the development of the phpBB Pages Extension.","fork":true,"url":"https://api.github.com/repos/VSEphpbb/pages","forks_url":"https://api.github.com/repos/VSEphpbb/pages/forks","keys_url":"https://api.github.com/repos/VSEphpbb/pages/keys{/key_id}","collaborators_url":"https://api.github.com/repos/VSEphpbb/pages/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/VSEphpbb/pages/teams","hooks_url":"https://api.github.com/repos/VSEphpbb/pages/hooks","issue_events_url":"https://api.github.com/repos/VSEphpbb/pages/issues/events{/number}","events_url":"https://api.github.com/repos/VSEphpbb/pages/events","assignees_url":"https://api.github.com/repos/VSEphpbb/pages/assignees{/user}","branches_url":"https://api.github.com/repos/VSEphpbb/pages/branches{/branch}","tags_url":"https://api.github.com/repos/VSEphpbb/pages/tags","blobs_url":"https://api.github.com/repos/VSEphpbb/pages/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/VSEphpbb/pages/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/VSEphpbb/pages/git/refs{/sha}","trees_url":"https://api.github.com/repos/VSEphpbb/pages/git/trees{/sha}","statuses_url":"https://api.github.com/repos/VSEphpbb/pages/statuses/{sha}","languages_url":"https://api.github.com/repos/VSEphpbb/pages/languages","stargazers_url":"https://api.github.com/repos/VSEphpbb/pages/stargazers","contributors_url":"https://api.github.com/repos/VSEphpbb/pages/contributors","subscribers_url":"https://api.github.com/repos/VSEphpbb/pages/subscribers","subscription_url":"https://api.github.com/repos/VSEphpbb/pages/subscription","commits_url":"https://api.github.com/repos/VSEphpbb/pages/commits{/sha}","git_commits_url":"https://api.github.com/repos/VSEphpbb/pages/git/commits{/sha}","comments_url":"https://api.github.com/repos/VSEphpbb/pages/comments{/number}","issue_comment_url":"https://api.github.com/repos/VSEphpbb/pages/issues/comments/{number}","contents_url":"https://api.github.com/repos/VSEphpbb/pages/contents/{+path}","compare_url":"https://api.github.com/repos/VSEphpbb/pages/compare/{base}...{head}","merges_url":"https://api.github.com/repos/VSEphpbb/pages/merges","archive_url":"https://api.github.com/repos/VSEphpbb/pages/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/VSEphpbb/pages/downloads","issues_url":"https://api.github.com/repos/VSEphpbb/pages/issues{/number}","pulls_url":"https://api.github.com/repos/VSEphpbb/pages/pulls{/number}","milestones_url":"https://api.github.com/repos/VSEphpbb/pages/milestones{/number}","notifications_url":"https://api.github.com/repos/VSEphpbb/pages/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/VSEphpbb/pages/labels{/name}","releases_url":"https://api.github.com/repos/VSEphpbb/pages/releases{/id}","created_at":"2014-08-18T16:42:04Z","updated_at":"2014-08-18T18:50:29Z","pushed_at":"2014-08-22T07:24:10Z","git_url":"git://github.com/VSEphpbb/pages.git","ssh_url":"git@github.com:VSEphpbb/pages.git","clone_url":"https://github.com/VSEphpbb/pages.git","svn_url":"https://github.com/VSEphpbb/pages","homepage":"https://www.phpbb.com/community/viewtopic.php?f=456&t=2257876","size":0,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"phpbb-extensions:master","ref":"master","sha":"1f37f711cb40323eded557a5905c992ea1b39a99","user":{"login":"phpbb-extensions","id":5825776,"avatar_url":"https://avatars.githubusercontent.com/u/5825776?v=2","gravatar_id":"cf23934d15908c132f1c236369262eb6","url":"https://api.github.com/users/phpbb-extensions","html_url":"https://github.com/phpbb-extensions","followers_url":"https://api.github.com/users/phpbb-extensions/followers","following_url":"https://api.github.com/users/phpbb-extensions/following{/other_user}","gists_url":"https://api.github.com/users/phpbb-extensions/gists{/gist_id}","starred_url":"https://api.github.com/users/phpbb-extensions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phpbb-extensions/subscriptions","organizations_url":"https://api.github.com/users/phpbb-extensions/orgs","repos_url":"https://api.github.com/users/phpbb-extensions/repos","events_url":"https://api.github.com/users/phpbb-extensions/events{/privacy}","received_events_url":"https://api.github.com/users/phpbb-extensions/received_events","type":"Organization","site_admin":false},"repo":{"id":23048542,"name":"pages","full_name":"phpbb-extensions/pages","owner":{"login":"phpbb-extensions","id":5825776,"avatar_url":"https://avatars.githubusercontent.com/u/5825776?v=2","gravatar_id":"cf23934d15908c132f1c236369262eb6","url":"https://api.github.com/users/phpbb-extensions","html_url":"https://github.com/phpbb-extensions","followers_url":"https://api.github.com/users/phpbb-extensions/followers","following_url":"https://api.github.com/users/phpbb-extensions/following{/other_user}","gists_url":"https://api.github.com/users/phpbb-extensions/gists{/gist_id}","starred_url":"https://api.github.com/users/phpbb-extensions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phpbb-extensions/subscriptions","organizations_url":"https://api.github.com/users/phpbb-extensions/orgs","repos_url":"https://api.github.com/users/phpbb-extensions/repos","events_url":"https://api.github.com/users/phpbb-extensions/events{/privacy}","received_events_url":"https://api.github.com/users/phpbb-extensions/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/phpbb-extensions/pages","description":"This is the repository for the development of the phpBB Pages Extension.","fork":false,"url":"https://api.github.com/repos/phpbb-extensions/pages","forks_url":"https://api.github.com/repos/phpbb-extensions/pages/forks","keys_url":"https://api.github.com/repos/phpbb-extensions/pages/keys{/key_id}","collaborators_url":"https://api.github.com/repos/phpbb-extensions/pages/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/phpbb-extensions/pages/teams","hooks_url":"https://api.github.com/repos/phpbb-extensions/pages/hooks","issue_events_url":"https://api.github.com/repos/phpbb-extensions/pages/issues/events{/number}","events_url":"https://api.github.com/repos/phpbb-extensions/pages/events","assignees_url":"https://api.github.com/repos/phpbb-extensions/pages/assignees{/user}","branches_url":"https://api.github.com/repos/phpbb-extensions/pages/branches{/branch}","tags_url":"https://api.github.com/repos/phpbb-extensions/pages/tags","blobs_url":"https://api.github.com/repos/phpbb-extensions/pages/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/phpbb-extensions/pages/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/phpbb-extensions/pages/git/refs{/sha}","trees_url":"https://api.github.com/repos/phpbb-extensions/pages/git/trees{/sha}","statuses_url":"https://api.github.com/repos/phpbb-extensions/pages/statuses/{sha}","languages_url":"https://api.github.com/repos/phpbb-extensions/pages/languages","stargazers_url":"https://api.github.com/repos/phpbb-extensions/pages/stargazers","contributors_url":"https://api.github.com/repos/phpbb-extensions/pages/contributors","subscribers_url":"https://api.github.com/repos/phpbb-extensions/pages/subscribers","subscription_url":"https://api.github.com/repos/phpbb-extensions/pages/subscription","commits_url":"https://api.github.com/repos/phpbb-extensions/pages/commits{/sha}","git_commits_url":"https://api.github.com/repos/phpbb-extensions/pages/git/commits{/sha}","comments_url":"https://api.github.com/repos/phpbb-extensions/pages/comments{/number}","issue_comment_url":"https://api.github.com/repos/phpbb-extensions/pages/issues/comments/{number}","contents_url":"https://api.github.com/repos/phpbb-extensions/pages/contents/{+path}","compare_url":"https://api.github.com/repos/phpbb-extensions/pages/compare/{base}...{head}","merges_url":"https://api.github.com/repos/phpbb-extensions/pages/merges","archive_url":"https://api.github.com/repos/phpbb-extensions/pages/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/phpbb-extensions/pages/downloads","issues_url":"https://api.github.com/repos/phpbb-extensions/pages/issues{/number}","pulls_url":"https://api.github.com/repos/phpbb-extensions/pages/pulls{/number}","milestones_url":"https://api.github.com/repos/phpbb-extensions/pages/milestones{/number}","notifications_url":"https://api.github.com/repos/phpbb-extensions/pages/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/phpbb-extensions/pages/labels{/name}","releases_url":"https://api.github.com/repos/phpbb-extensions/pages/releases{/id}","created_at":"2014-08-17T19:29:42Z","updated_at":"2014-08-18T16:40:18Z","pushed_at":"2014-08-22T02:49:37Z","git_url":"git://github.com/phpbb-extensions/pages.git","ssh_url":"git@github.com:phpbb-extensions/pages.git","clone_url":"https://github.com/phpbb-extensions/pages.git","svn_url":"https://github.com/phpbb-extensions/pages","homepage":"https://www.phpbb.com/community/viewtopic.php?f=456&t=2257876","size":0,"stargazers_count":4,"watchers_count":4,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":3,"mirror_url":null,"open_issues_count":1,"forks":3,"open_issues":1,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/phpbb-extensions/pages/pulls/5"},"html":{"href":"https://github.com/phpbb-extensions/pages/pull/5"},"issue":{"href":"https://api.github.com/repos/phpbb-extensions/pages/issues/5"},"comments":{"href":"https://api.github.com/repos/phpbb-extensions/pages/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/phpbb-extensions/pages/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/phpbb-extensions/pages/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/phpbb-extensions/pages/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/phpbb-extensions/pages/statuses/dec75832418845b17e84f40826ac90c0810756ac"}}}}