{"action":"created","issue":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/5152","repository_url":"https://api.github.com/repos/yiisoft/yii2","labels_url":"https://api.github.com/repos/yiisoft/yii2/issues/5152/labels{/name}","comments_url":"https://api.github.com/repos/yiisoft/yii2/issues/5152/comments","events_url":"https://api.github.com/repos/yiisoft/yii2/issues/5152/events","html_url":"https://github.com/yiisoft/yii2/issues/5152","id":43667390,"number":5152,"title":"count() method is returning string not integer","user":{"login":"nenad-zivkovic","id":8584827,"avatar_url":"https://avatars0.githubusercontent.com/u/8584827?v=4","gravatar_id":"","url":"https://api.github.com/users/nenad-zivkovic","html_url":"https://github.com/nenad-zivkovic","followers_url":"https://api.github.com/users/nenad-zivkovic/followers","following_url":"https://api.github.com/users/nenad-zivkovic/following{/other_user}","gists_url":"https://api.github.com/users/nenad-zivkovic/gists{/gist_id}","starred_url":"https://api.github.com/users/nenad-zivkovic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nenad-zivkovic/subscriptions","organizations_url":"https://api.github.com/users/nenad-zivkovic/orgs","repos_url":"https://api.github.com/users/nenad-zivkovic/repos","events_url":"https://api.github.com/users/nenad-zivkovic/events{/privacy}","received_events_url":"https://api.github.com/users/nenad-zivkovic/received_events","type":"User","site_admin":false},"labels":[{"id":115010082,"url":"https://api.github.com/repos/yiisoft/yii2/labels/feature:db","name":"feature:db","color":"bfd4f2","default":false},{"id":116381991,"url":"https://api.github.com/repos/yiisoft/yii2/labels/severity:BC%20breaking","name":"severity:BC breaking","color":"eb6420","default":false},{"id":33330247,"url":"https://api.github.com/repos/yiisoft/yii2/labels/status:ready%20for%20adoption","name":"status:ready for adoption","color":"02e10c","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/yiisoft/yii2/milestones/22","html_url":"https://github.com/yiisoft/yii2/milestone/22","labels_url":"https://api.github.com/repos/yiisoft/yii2/milestones/22/labels","id":1962396,"number":22,"title":"2.1.0","description":"","creator":{"login":"samdark","id":47294,"avatar_url":"https://avatars2.githubusercontent.com/u/47294?v=4","gravatar_id":"","url":"https://api.github.com/users/samdark","html_url":"https://github.com/samdark","followers_url":"https://api.github.com/users/samdark/followers","following_url":"https://api.github.com/users/samdark/following{/other_user}","gists_url":"https://api.github.com/users/samdark/gists{/gist_id}","starred_url":"https://api.github.com/users/samdark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samdark/subscriptions","organizations_url":"https://api.github.com/users/samdark/orgs","repos_url":"https://api.github.com/users/samdark/repos","events_url":"https://api.github.com/users/samdark/events{/privacy}","received_events_url":"https://api.github.com/users/samdark/received_events","type":"User","site_admin":false},"open_issues":200,"closed_issues":89,"state":"open","created_at":"2016-08-25T07:42:19Z","updated_at":"2017-12-26T16:06:59Z","due_on":null,"closed_at":null},"comments":18,"created_at":"2014-09-23T18:44:15Z","updated_at":"2017-12-27T08:25:23Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"If you use count() method to return the number of rows in your table, you will get the number but as string not integer. You can check that yourself, just var dump the result of your query. Documentation of count() says that it should return integer, and that is what I was hoping for, but got surprised with result. Is this (not)working as intended or I am missing something ?\n\nDocs: http://www.yiiframework.com/doc-2.0/yii-db-query.html#count%28%29-detail\n\nI was doing very simple query `$numberOfUsers = User::find()->count();`\n\nI use the latest yii2, downloaded today.\n"},"comment":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/comments/354074575","html_url":"https://github.com/yiisoft/yii2/issues/5152#issuecomment-354074575","issue_url":"https://api.github.com/repos/yiisoft/yii2/issues/5152","id":354074575,"user":{"login":"dynasource","id":125726,"avatar_url":"https://avatars2.githubusercontent.com/u/125726?v=4","gravatar_id":"","url":"https://api.github.com/users/dynasource","html_url":"https://github.com/dynasource","followers_url":"https://api.github.com/users/dynasource/followers","following_url":"https://api.github.com/users/dynasource/following{/other_user}","gists_url":"https://api.github.com/users/dynasource/gists{/gist_id}","starred_url":"https://api.github.com/users/dynasource/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dynasource/subscriptions","organizations_url":"https://api.github.com/users/dynasource/orgs","repos_url":"https://api.github.com/users/dynasource/repos","events_url":"https://api.github.com/users/dynasource/events{/privacy}","received_events_url":"https://api.github.com/users/dynasource/received_events","type":"User","site_admin":false},"created_at":"2017-12-27T08:25:23Z","updated_at":"2017-12-27T08:25:23Z","author_association":"MEMBER","body":"whether there is an abstraction layer between it or not, one expects a count function to return a number, not a string. This is the most intuitive result. "}}
{"actor":{"display_login":"dynasource"}}