{"action":"created","issue":{"url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/3847","labels_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/3847/labels{/name}","comments_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/3847/comments","events_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/3847/events","html_url":"https://github.com/silverstripe/silverstripe-framework/issues/3847","id":56367575,"number":3847,"title":"SS_List interface map method not implemented consistently","user":{"login":"dhensby","id":563596,"avatar_url":"https://avatars.githubusercontent.com/u/563596?v=3","gravatar_id":"","url":"https://api.github.com/users/dhensby","html_url":"https://github.com/dhensby","followers_url":"https://api.github.com/users/dhensby/followers","following_url":"https://api.github.com/users/dhensby/following{/other_user}","gists_url":"https://api.github.com/users/dhensby/gists{/gist_id}","starred_url":"https://api.github.com/users/dhensby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhensby/subscriptions","organizations_url":"https://api.github.com/users/dhensby/orgs","repos_url":"https://api.github.com/users/dhensby/repos","events_url":"https://api.github.com/users/dhensby/events{/privacy}","received_events_url":"https://api.github.com/users/dhensby/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-03T11:49:13Z","updated_at":"2015-02-04T02:58:57Z","closed_at":null,"body":"According to the PHP doc the function `map` on classes that implement the `SS_List` interface should return an `array`.\r\n\r\nHowever, `DataList` returns an `SS_Map` and `ArrayList` returns an `array`.\r\n\r\nThis leads to inconsistencies in how `ArrayList`s and `DataList`s should be handled when turning them into a map.\r\n\r\nShould we be returning an `SS_Map` or an `array` (as documented)\r\n\r\n---\r\n\r\nPHPDoc:\r\n\r\n```php\r\n\t/**\r\n\t * Returns a map of a key field to a value field of all the items in the\r\n\t * list.\r\n\t *\r\n\t * @param  string $keyfield\r\n\t * @param  string $titlefield\r\n\t * @return array\r\n\t */\r\n\tpublic function map($keyfield = 'ID', $titlefield = 'Title');\r\n```"},"comment":{"url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/comments/72781871","html_url":"https://github.com/silverstripe/silverstripe-framework/issues/3847#issuecomment-72781871","issue_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/3847","id":72781871,"user":{"login":"wilr","id":101629,"avatar_url":"https://avatars.githubusercontent.com/u/101629?v=3","gravatar_id":"","url":"https://api.github.com/users/wilr","html_url":"https://github.com/wilr","followers_url":"https://api.github.com/users/wilr/followers","following_url":"https://api.github.com/users/wilr/following{/other_user}","gists_url":"https://api.github.com/users/wilr/gists{/gist_id}","starred_url":"https://api.github.com/users/wilr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilr/subscriptions","organizations_url":"https://api.github.com/users/wilr/orgs","repos_url":"https://api.github.com/users/wilr/repos","events_url":"https://api.github.com/users/wilr/events{/privacy}","received_events_url":"https://api.github.com/users/wilr/received_events","type":"User","site_admin":false},"created_at":"2015-02-04T02:58:57Z","updated_at":"2015-02-04T02:58:57Z","body":"IMHO, map() should return a SS_Map consistently. Map then has a toArray() but this would be a 4.0 / master change."}}