{"action":"created","comment":{"url":"https://api.github.com/repos/yiisoft/yii2/pulls/comments/79341492","id":79341492,"diff_hunk":"@@ -248,6 +248,19 @@ public function one($db = null)\n     }\n \n     /**\n+     * Executes the query and returns a first single row of result.\n+     * @param Connection $db the database connection used to generate the SQL statement.\n+     * If this parameter is not given, the `db` application component will be used.\n+     * @return array|boolean the first row (in terms of an array) of the query result. False is returned if the query","path":"framework/db/Query.php","position":7,"original_position":7,"commit_id":"027e3e63df18ded8e82e38da1f249c547f5e9381","original_commit_id":"027e3e63df18ded8e82e38da1f249c547f5e9381","user":{"login":"SilverFire","id":4499203,"avatar_url":"https://avatars.githubusercontent.com/u/4499203?v=3","gravatar_id":"","url":"https://api.github.com/users/SilverFire","html_url":"https://github.com/SilverFire","followers_url":"https://api.github.com/users/SilverFire/followers","following_url":"https://api.github.com/users/SilverFire/following{/other_user}","gists_url":"https://api.github.com/users/SilverFire/gists{/gist_id}","starred_url":"https://api.github.com/users/SilverFire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SilverFire/subscriptions","organizations_url":"https://api.github.com/users/SilverFire/orgs","repos_url":"https://api.github.com/users/SilverFire/repos","events_url":"https://api.github.com/users/SilverFire/events{/privacy}","received_events_url":"https://api.github.com/users/SilverFire/received_events","type":"User","site_admin":false},"body":"`static` will be returned, not array, won't it?","created_at":"2016-09-19T08:04:18Z","updated_at":"2016-09-19T08:05:11Z","html_url":"https://github.com/yiisoft/yii2/pull/12563#discussion_r79341492","pull_request_url":"https://api.github.com/repos/yiisoft/yii2/pulls/12563","_links":{"self":{"href":"https://api.github.com/repos/yiisoft/yii2/pulls/comments/79341492"},"html":{"href":"https://github.com/yiisoft/yii2/pull/12563#discussion_r79341492"},"pull_request":{"href":"https://api.github.com/repos/yiisoft/yii2/pulls/12563"}}},"pull_request":{"url":"https://api.github.com/repos/yiisoft/yii2/pulls/12563","id":85727227,"html_url":"https://github.com/yiisoft/yii2/pull/12563","diff_url":"https://github.com/yiisoft/yii2/pull/12563.diff","patch_url":"https://github.com/yiisoft/yii2/pull/12563.patch","issue_url":"https://api.github.com/repos/yiisoft/yii2/issues/12563","number":12563,"state":"closed","locked":false,"title":"Added first() method to ActiveRecord and Query classes.","user":{"login":"zalatov","id":7518216,"avatar_url":"https://avatars.githubusercontent.com/u/7518216?v=3","gravatar_id":"","url":"https://api.github.com/users/zalatov","html_url":"https://github.com/zalatov","followers_url":"https://api.github.com/users/zalatov/followers","following_url":"https://api.github.com/users/zalatov/following{/other_user}","gists_url":"https://api.github.com/users/zalatov/gists{/gist_id}","starred_url":"https://api.github.com/users/zalatov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zalatov/subscriptions","organizations_url":"https://api.github.com/users/zalatov/orgs","repos_url":"https://api.github.com/users/zalatov/repos","events_url":"https://api.github.com/users/zalatov/events{/privacy}","received_events_url":"https://api.github.com/users/zalatov/received_events","type":"User","site_admin":false},"body":"| Q             | A\r\n| ------------- | ---\r\n| Is bugfix?    | no\r\n| New feature?  | yes\r\n| Breaks BC?    | no\r\n| Tests pass?   | yes\r\n| Fixed issues  | \r\n\r\nFind one selects all data from DB and then reduce it to one record.\r\nFind first set limit to returned data.\r\n\r\nFor example, you can execute this:\r\n``\r\n$lastLog = BigLogTable::find()->orderBy(['insert_stamp' => SORT_DESC])->one();\r\n``\r\nAnd you do not suspect that all entries will be selected before result truncated to one record.\r\n\r\nThis speciality discussed on yii forums, but not included in repository yet.","created_at":"2016-09-18T23:44:57Z","updated_at":"2016-09-19T08:05:11Z","closed_at":"2016-09-19T07:57:26Z","merged_at":null,"merge_commit_sha":"8a370727e782680f3fad94cbaf4a99e33d51b11c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/yiisoft/yii2/pulls/12563/commits","review_comments_url":"https://api.github.com/repos/yiisoft/yii2/pulls/12563/comments","review_comment_url":"https://api.github.com/repos/yiisoft/yii2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/yiisoft/yii2/issues/12563/comments","statuses_url":"https://api.github.com/repos/yiisoft/yii2/statuses/027e3e63df18ded8e82e38da1f249c547f5e9381","head":{"label":"zalatov:feature-query-first-method","ref":"feature-query-first-method","sha":"027e3e63df18ded8e82e38da1f249c547f5e9381","user":{"login":"zalatov","id":7518216,"avatar_url":"https://avatars.githubusercontent.com/u/7518216?v=3","gravatar_id":"","url":"https://api.github.com/users/zalatov","html_url":"https://github.com/zalatov","followers_url":"https://api.github.com/users/zalatov/followers","following_url":"https://api.github.com/users/zalatov/following{/other_user}","gists_url":"https://api.github.com/users/zalatov/gists{/gist_id}","starred_url":"https://api.github.com/users/zalatov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zalatov/subscriptions","organizations_url":"https://api.github.com/users/zalatov/orgs","repos_url":"https://api.github.com/users/zalatov/repos","events_url":"https://api.github.com/users/zalatov/events{/privacy}","received_events_url":"https://api.github.com/users/zalatov/received_events","type":"User","site_admin":false},"repo":{"id":55577719,"name":"yii2","full_name":"zalatov/yii2","owner":{"login":"zalatov","id":7518216,"avatar_url":"https://avatars.githubusercontent.com/u/7518216?v=3","gravatar_id":"","url":"https://api.github.com/users/zalatov","html_url":"https://github.com/zalatov","followers_url":"https://api.github.com/users/zalatov/followers","following_url":"https://api.github.com/users/zalatov/following{/other_user}","gists_url":"https://api.github.com/users/zalatov/gists{/gist_id}","starred_url":"https://api.github.com/users/zalatov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zalatov/subscriptions","organizations_url":"https://api.github.com/users/zalatov/orgs","repos_url":"https://api.github.com/users/zalatov/repos","events_url":"https://api.github.com/users/zalatov/events{/privacy}","received_events_url":"https://api.github.com/users/zalatov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zalatov/yii2","description":"Yii 2 framework main development repo","fork":true,"url":"https://api.github.com/repos/zalatov/yii2","forks_url":"https://api.github.com/repos/zalatov/yii2/forks","keys_url":"https://api.github.com/repos/zalatov/yii2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zalatov/yii2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zalatov/yii2/teams","hooks_url":"https://api.github.com/repos/zalatov/yii2/hooks","issue_events_url":"https://api.github.com/repos/zalatov/yii2/issues/events{/number}","events_url":"https://api.github.com/repos/zalatov/yii2/events","assignees_url":"https://api.github.com/repos/zalatov/yii2/assignees{/user}","branches_url":"https://api.github.com/repos/zalatov/yii2/branches{/branch}","tags_url":"https://api.github.com/repos/zalatov/yii2/tags","blobs_url":"https://api.github.com/repos/zalatov/yii2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zalatov/yii2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zalatov/yii2/git/refs{/sha}","trees_url":"https://api.github.com/repos/zalatov/yii2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zalatov/yii2/statuses/{sha}","languages_url":"https://api.github.com/repos/zalatov/yii2/languages","stargazers_url":"https://api.github.com/repos/zalatov/yii2/stargazers","contributors_url":"https://api.github.com/repos/zalatov/yii2/contributors","subscribers_url":"https://api.github.com/repos/zalatov/yii2/subscribers","subscription_url":"https://api.github.com/repos/zalatov/yii2/subscription","commits_url":"https://api.github.com/repos/zalatov/yii2/commits{/sha}","git_commits_url":"https://api.github.com/repos/zalatov/yii2/git/commits{/sha}","comments_url":"https://api.github.com/repos/zalatov/yii2/comments{/number}","issue_comment_url":"https://api.github.com/repos/zalatov/yii2/issues/comments{/number}","contents_url":"https://api.github.com/repos/zalatov/yii2/contents/{+path}","compare_url":"https://api.github.com/repos/zalatov/yii2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zalatov/yii2/merges","archive_url":"https://api.github.com/repos/zalatov/yii2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zalatov/yii2/downloads","issues_url":"https://api.github.com/repos/zalatov/yii2/issues{/number}","pulls_url":"https://api.github.com/repos/zalatov/yii2/pulls{/number}","milestones_url":"https://api.github.com/repos/zalatov/yii2/milestones{/number}","notifications_url":"https://api.github.com/repos/zalatov/yii2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zalatov/yii2/labels{/name}","releases_url":"https://api.github.com/repos/zalatov/yii2/releases{/id}","deployments_url":"https://api.github.com/repos/zalatov/yii2/deployments","created_at":"2016-04-06T05:17:26Z","updated_at":"2016-04-06T05:17:29Z","pushed_at":"2016-09-19T03:35:06Z","git_url":"git://github.com/zalatov/yii2.git","ssh_url":"git@github.com:zalatov/yii2.git","clone_url":"https://github.com/zalatov/yii2.git","svn_url":"https://github.com/zalatov/yii2","homepage":"http://www.yiiframework.com","size":35790,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"yiisoft:master","ref":"master","sha":"cef5404de066473c2d5456191b5391636cd12d92","user":{"login":"yiisoft","id":993323,"avatar_url":"https://avatars.githubusercontent.com/u/993323?v=3","gravatar_id":"","url":"https://api.github.com/users/yiisoft","html_url":"https://github.com/yiisoft","followers_url":"https://api.github.com/users/yiisoft/followers","following_url":"https://api.github.com/users/yiisoft/following{/other_user}","gists_url":"https://api.github.com/users/yiisoft/gists{/gist_id}","starred_url":"https://api.github.com/users/yiisoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yiisoft/subscriptions","organizations_url":"https://api.github.com/users/yiisoft/orgs","repos_url":"https://api.github.com/users/yiisoft/repos","events_url":"https://api.github.com/users/yiisoft/events{/privacy}","received_events_url":"https://api.github.com/users/yiisoft/received_events","type":"Organization","site_admin":false},"repo":{"id":3431193,"name":"yii2","full_name":"yiisoft/yii2","owner":{"login":"yiisoft","id":993323,"avatar_url":"https://avatars.githubusercontent.com/u/993323?v=3","gravatar_id":"","url":"https://api.github.com/users/yiisoft","html_url":"https://github.com/yiisoft","followers_url":"https://api.github.com/users/yiisoft/followers","following_url":"https://api.github.com/users/yiisoft/following{/other_user}","gists_url":"https://api.github.com/users/yiisoft/gists{/gist_id}","starred_url":"https://api.github.com/users/yiisoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yiisoft/subscriptions","organizations_url":"https://api.github.com/users/yiisoft/orgs","repos_url":"https://api.github.com/users/yiisoft/repos","events_url":"https://api.github.com/users/yiisoft/events{/privacy}","received_events_url":"https://api.github.com/users/yiisoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/yiisoft/yii2","description":"Yii 2 framework main development repo","fork":false,"url":"https://api.github.com/repos/yiisoft/yii2","forks_url":"https://api.github.com/repos/yiisoft/yii2/forks","keys_url":"https://api.github.com/repos/yiisoft/yii2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yiisoft/yii2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yiisoft/yii2/teams","hooks_url":"https://api.github.com/repos/yiisoft/yii2/hooks","issue_events_url":"https://api.github.com/repos/yiisoft/yii2/issues/events{/number}","events_url":"https://api.github.com/repos/yiisoft/yii2/events","assignees_url":"https://api.github.com/repos/yiisoft/yii2/assignees{/user}","branches_url":"https://api.github.com/repos/yiisoft/yii2/branches{/branch}","tags_url":"https://api.github.com/repos/yiisoft/yii2/tags","blobs_url":"https://api.github.com/repos/yiisoft/yii2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yiisoft/yii2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yiisoft/yii2/git/refs{/sha}","trees_url":"https://api.github.com/repos/yiisoft/yii2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yiisoft/yii2/statuses/{sha}","languages_url":"https://api.github.com/repos/yiisoft/yii2/languages","stargazers_url":"https://api.github.com/repos/yiisoft/yii2/stargazers","contributors_url":"https://api.github.com/repos/yiisoft/yii2/contributors","subscribers_url":"https://api.github.com/repos/yiisoft/yii2/subscribers","subscription_url":"https://api.github.com/repos/yiisoft/yii2/subscription","commits_url":"https://api.github.com/repos/yiisoft/yii2/commits{/sha}","git_commits_url":"https://api.github.com/repos/yiisoft/yii2/git/commits{/sha}","comments_url":"https://api.github.com/repos/yiisoft/yii2/comments{/number}","issue_comment_url":"https://api.github.com/repos/yiisoft/yii2/issues/comments{/number}","contents_url":"https://api.github.com/repos/yiisoft/yii2/contents/{+path}","compare_url":"https://api.github.com/repos/yiisoft/yii2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yiisoft/yii2/merges","archive_url":"https://api.github.com/repos/yiisoft/yii2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yiisoft/yii2/downloads","issues_url":"https://api.github.com/repos/yiisoft/yii2/issues{/number}","pulls_url":"https://api.github.com/repos/yiisoft/yii2/pulls{/number}","milestones_url":"https://api.github.com/repos/yiisoft/yii2/milestones{/number}","notifications_url":"https://api.github.com/repos/yiisoft/yii2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yiisoft/yii2/labels{/name}","releases_url":"https://api.github.com/repos/yiisoft/yii2/releases{/id}","deployments_url":"https://api.github.com/repos/yiisoft/yii2/deployments","created_at":"2012-02-13T15:32:36Z","updated_at":"2016-09-19T05:51:07Z","pushed_at":"2016-09-19T07:40:16Z","git_url":"git://github.com/yiisoft/yii2.git","ssh_url":"git@github.com:yiisoft/yii2.git","clone_url":"https://github.com/yiisoft/yii2.git","svn_url":"https://github.com/yiisoft/yii2","homepage":"http://www.yiiframework.com","size":62872,"stargazers_count":8734,"watchers_count":8734,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5089,"mirror_url":null,"open_issues_count":927,"forks":5089,"open_issues":927,"watchers":8734,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/yiisoft/yii2/pulls/12563"},"html":{"href":"https://github.com/yiisoft/yii2/pull/12563"},"issue":{"href":"https://api.github.com/repos/yiisoft/yii2/issues/12563"},"comments":{"href":"https://api.github.com/repos/yiisoft/yii2/issues/12563/comments"},"review_comments":{"href":"https://api.github.com/repos/yiisoft/yii2/pulls/12563/comments"},"review_comment":{"href":"https://api.github.com/repos/yiisoft/yii2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/yiisoft/yii2/pulls/12563/commits"},"statuses":{"href":"https://api.github.com/repos/yiisoft/yii2/statuses/027e3e63df18ded8e82e38da1f249c547f5e9381"}}}}
{"actor":{"display_login":"SilverFire"}}