{"action":"created","issue":{"url":"https://api.github.com/repos/bcosca/fatfree-core/issues/103","labels_url":"https://api.github.com/repos/bcosca/fatfree-core/issues/103/labels{/name}","comments_url":"https://api.github.com/repos/bcosca/fatfree-core/issues/103/comments","events_url":"https://api.github.com/repos/bcosca/fatfree-core/issues/103/events","html_url":"https://github.com/bcosca/fatfree-core/issues/103","id":119585672,"number":103,"title":"DB mapper: onload event","user":{"login":"xfra35","id":1838531,"avatar_url":"https://avatars.githubusercontent.com/u/1838531?v=3","gravatar_id":"","url":"https://api.github.com/users/xfra35","html_url":"https://github.com/xfra35","followers_url":"https://api.github.com/users/xfra35/followers","following_url":"https://api.github.com/users/xfra35/following{/other_user}","gists_url":"https://api.github.com/users/xfra35/gists{/gist_id}","starred_url":"https://api.github.com/users/xfra35/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xfra35/subscriptions","organizations_url":"https://api.github.com/users/xfra35/orgs","repos_url":"https://api.github.com/users/xfra35/repos","events_url":"https://api.github.com/users/xfra35/events{/privacy}","received_events_url":"https://api.github.com/users/xfra35/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-11-30T21:32:44Z","updated_at":"2015-12-02T20:18:23Z","closed_at":null,"body":"It just occurred to me that the `onload` event seems to overtrigger.\r\n\r\nSee:\r\n```php\r\n$mapper=new DB\\SQL\\Mapper($db,'mytable');// 3 record ids: 1,2,3\r\n$mapper->onload(function($me){\r\n  echo $me->id.',';\r\n});\r\n$mapper->load();// output: 1,2,3,1,\r\n$mapper->next();// output: 2,\r\n$mapper->next();// output: 3,\r\n```\r\n\r\nThis behaviour is due to the fact that both `skip()` and `factory()` trigger that event. I think we should trigger it in one single place."},"comment":{"url":"https://api.github.com/repos/bcosca/fatfree-core/issues/comments/161421315","html_url":"https://github.com/bcosca/fatfree-core/issues/103#issuecomment-161421315","issue_url":"https://api.github.com/repos/bcosca/fatfree-core/issues/103","id":161421315,"user":{"login":"xfra35","id":1838531,"avatar_url":"https://avatars.githubusercontent.com/u/1838531?v=3","gravatar_id":"","url":"https://api.github.com/users/xfra35","html_url":"https://github.com/xfra35","followers_url":"https://api.github.com/users/xfra35/followers","following_url":"https://api.github.com/users/xfra35/following{/other_user}","gists_url":"https://api.github.com/users/xfra35/gists{/gist_id}","starred_url":"https://api.github.com/users/xfra35/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xfra35/subscriptions","organizations_url":"https://api.github.com/users/xfra35/orgs","repos_url":"https://api.github.com/users/xfra35/repos","events_url":"https://api.github.com/users/xfra35/events{/privacy}","received_events_url":"https://api.github.com/users/xfra35/received_events","type":"User","site_admin":false},"created_at":"2015-12-02T20:18:23Z","updated_at":"2015-12-02T20:18:23Z","body":"Ah no, wait a bit. That won't work since `load()` itself triggers indirectly `factory()`."}}