{"action":"created","issue":{"url":"https://api.github.com/repos/RalfEggert/zend-expressive-tutorial/issues/6","labels_url":"https://api.github.com/repos/RalfEggert/zend-expressive-tutorial/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/RalfEggert/zend-expressive-tutorial/issues/6/comments","events_url":"https://api.github.com/repos/RalfEggert/zend-expressive-tutorial/issues/6/events","html_url":"https://github.com/RalfEggert/zend-expressive-tutorial/issues/6","id":121644196,"number":6,"title":"Repositories and table gateways","user":{"login":"RalfEggert","id":1562549,"avatar_url":"https://avatars.githubusercontent.com/u/1562549?v=3","gravatar_id":"","url":"https://api.github.com/users/RalfEggert","html_url":"https://github.com/RalfEggert","followers_url":"https://api.github.com/users/RalfEggert/followers","following_url":"https://api.github.com/users/RalfEggert/following{/other_user}","gists_url":"https://api.github.com/users/RalfEggert/gists{/gist_id}","starred_url":"https://api.github.com/users/RalfEggert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RalfEggert/subscriptions","organizations_url":"https://api.github.com/users/RalfEggert/orgs","repos_url":"https://api.github.com/users/RalfEggert/repos","events_url":"https://api.github.com/users/RalfEggert/events{/privacy}","received_events_url":"https://api.github.com/users/RalfEggert/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/RalfEggert/zend-expressive-tutorial/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/RalfEggert/zend-expressive-tutorial/labels/help%20wanted","name":"help wanted","color":"159818"}],"state":"open","locked":false,"assignee":{"login":"RalfEggert","id":1562549,"avatar_url":"https://avatars.githubusercontent.com/u/1562549?v=3","gravatar_id":"","url":"https://api.github.com/users/RalfEggert","html_url":"https://github.com/RalfEggert","followers_url":"https://api.github.com/users/RalfEggert/followers","following_url":"https://api.github.com/users/RalfEggert/following{/other_user}","gists_url":"https://api.github.com/users/RalfEggert/gists{/gist_id}","starred_url":"https://api.github.com/users/RalfEggert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RalfEggert/subscriptions","organizations_url":"https://api.github.com/users/RalfEggert/orgs","repos_url":"https://api.github.com/users/RalfEggert/repos","events_url":"https://api.github.com/users/RalfEggert/events{/privacy}","received_events_url":"https://api.github.com/users/RalfEggert/received_events","type":"User","site_admin":false},"milestone":null,"comments":11,"created_at":"2015-12-11T06:04:33Z","updated_at":"2015-12-11T20:11:32Z","closed_at":null,"body":"I merged the changes from @mtymek now. I like the addition of the repository but I think the way it is implemented is still suboptimal. \r\n\r\nFrom my point of view the repository uses the table gateway or another data source and requests data or sends data to the persistence layer. The repository shouldn't really know how the data source / table gateway is using it. If it is a database, a web service or the file system. \r\n\r\nIn the current state, we have a mixture of SQL knowledge in both table gateway and repository. \r\n\r\nI would prefer both. An `AlbumTable` that extends `TableGateway`and provides the generation of the SQL objects. And an `AlbumRepository` that uses the `AlbumTable` for persistence by calling its methods and adding logic like the decision for an insert or an update.\r\n\r\nThoughts?"},"comment":{"url":"https://api.github.com/repos/RalfEggert/zend-expressive-tutorial/issues/comments/164037087","html_url":"https://github.com/RalfEggert/zend-expressive-tutorial/issues/6#issuecomment-164037087","issue_url":"https://api.github.com/repos/RalfEggert/zend-expressive-tutorial/issues/6","id":164037087,"user":{"login":"mtymek","id":777893,"avatar_url":"https://avatars.githubusercontent.com/u/777893?v=3","gravatar_id":"","url":"https://api.github.com/users/mtymek","html_url":"https://github.com/mtymek","followers_url":"https://api.github.com/users/mtymek/followers","following_url":"https://api.github.com/users/mtymek/following{/other_user}","gists_url":"https://api.github.com/users/mtymek/gists{/gist_id}","starred_url":"https://api.github.com/users/mtymek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mtymek/subscriptions","organizations_url":"https://api.github.com/users/mtymek/orgs","repos_url":"https://api.github.com/users/mtymek/repos","events_url":"https://api.github.com/users/mtymek/events{/privacy}","received_events_url":"https://api.github.com/users/mtymek/received_events","type":"User","site_admin":false},"created_at":"2015-12-11T20:11:32Z","updated_at":"2015-12-11T20:11:32Z","body":"I'd also like to make repository more strict:\r\n\r\n* `fetchSingleAlbum` should return entity OR throw exception if it does not exist\r\n* `saveAlbum` and `deleteAlbum` should not return anything. If entity cannot be saved - they should throw an exception.\r\n\r\nThoughts?"}}