{"action":"opened","issue":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/7701","labels_url":"https://api.github.com/repos/yiisoft/yii2/issues/7701/labels{/name}","comments_url":"https://api.github.com/repos/yiisoft/yii2/issues/7701/comments","events_url":"https://api.github.com/repos/yiisoft/yii2/issues/7701/events","html_url":"https://github.com/yiisoft/yii2/issues/7701","id":61012309,"number":7701,"title":"batch() / each()","user":{"login":"longmayar","id":10117816,"avatar_url":"https://avatars.githubusercontent.com/u/10117816?v=3","gravatar_id":"","url":"https://api.github.com/users/longmayar","html_url":"https://github.com/longmayar","followers_url":"https://api.github.com/users/longmayar/followers","following_url":"https://api.github.com/users/longmayar/following{/other_user}","gists_url":"https://api.github.com/users/longmayar/gists{/gist_id}","starred_url":"https://api.github.com/users/longmayar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/longmayar/subscriptions","organizations_url":"https://api.github.com/users/longmayar/orgs","repos_url":"https://api.github.com/users/longmayar/repos","events_url":"https://api.github.com/users/longmayar/events{/privacy}","received_events_url":"https://api.github.com/users/longmayar/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-13T08:29:51Z","updated_at":"2015-03-13T08:29:51Z","closed_at":null,"body":"I need to select batches by 10 at time (from 1000000+ rows)\r\n```php\r\nforeach (Song::find()->batch(10) as $songs) {\r\n\r\n    // var_dump($songs);      <-- array 10 object(app\\models\\Song)\r\n\r\n    foreach ($songs as $song) {\r\n        var_dump($song->id);\r\n    }\r\n}\r\n```\r\nIt takes 10 objects, but it doesn't take next 10. How can i do it?  "}}