{"action":"created","issue":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/10121","labels_url":"https://api.github.com/repos/yiisoft/yii2/issues/10121/labels{/name}","comments_url":"https://api.github.com/repos/yiisoft/yii2/issues/10121/comments","events_url":"https://api.github.com/repos/yiisoft/yii2/issues/10121/events","html_url":"https://github.com/yiisoft/yii2/pull/10121","id":115763097,"number":10121,"title":"Catalogue support for models","user":{"login":"Faryshta","id":2029247,"avatar_url":"https://avatars.githubusercontent.com/u/2029247?v=3","gravatar_id":"","url":"https://api.github.com/users/Faryshta","html_url":"https://github.com/Faryshta","followers_url":"https://api.github.com/users/Faryshta/followers","following_url":"https://api.github.com/users/Faryshta/following{/other_user}","gists_url":"https://api.github.com/users/Faryshta/gists{/gist_id}","starred_url":"https://api.github.com/users/Faryshta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Faryshta/subscriptions","organizations_url":"https://api.github.com/users/Faryshta/orgs","repos_url":"https://api.github.com/users/Faryshta/repos","events_url":"https://api.github.com/users/Faryshta/events{/privacy}","received_events_url":"https://api.github.com/users/Faryshta/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/yiisoft/yii2/labels/status:under%20discussion","name":"status:under discussion","color":"f7c6c7"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":20,"created_at":"2015-11-08T21:38:24Z","updated_at":"2015-11-19T19:55:51Z","closed_at":"2015-11-17T10:00:49Z","pull_request":{"url":"https://api.github.com/repos/yiisoft/yii2/pulls/10121","html_url":"https://github.com/yiisoft/yii2/pull/10121","diff_url":"https://github.com/yiisoft/yii2/pull/10121.diff","patch_url":"https://github.com/yiisoft/yii2/pull/10121.patch"},"body":"I don't know if this is done in other frameworks with other names.\r\n\r\nThe case usage is that on the database sometimes the columns contain an index or abbreviaton of the value to be shown to the user. Other times the data needs to be translated to be shown and it can be time consuming to type `Yii::t('app', $model->attribute)` everytime its used or create internal methods to do it.\r\n\r\nWith this there is an introduction to a new functionality named `Model::catalogues()` which handles static data to be used inside the class. The data can be accesed using the `Model::getTerminology()` static method or `Model::getAttributeTerminology` instanced method.\r\n\r\nThe method `Model::catalogues contain documentation with usage examples.`\r\n\r\n- [x] functional methods.\r\n- [x] phpDoc\r\n- [x] Unit tests\r\n- [ ] include it on the model guide.\r\n- [ ] squash commits on another branch"},"comment":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/comments/158177038","html_url":"https://github.com/yiisoft/yii2/pull/10121#issuecomment-158177038","issue_url":"https://api.github.com/repos/yiisoft/yii2/issues/10121","id":158177038,"user":{"login":"Faryshta","id":2029247,"avatar_url":"https://avatars.githubusercontent.com/u/2029247?v=3","gravatar_id":"","url":"https://api.github.com/users/Faryshta","html_url":"https://github.com/Faryshta","followers_url":"https://api.github.com/users/Faryshta/followers","following_url":"https://api.github.com/users/Faryshta/following{/other_user}","gists_url":"https://api.github.com/users/Faryshta/gists{/gist_id}","starred_url":"https://api.github.com/users/Faryshta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Faryshta/subscriptions","organizations_url":"https://api.github.com/users/Faryshta/orgs","repos_url":"https://api.github.com/users/Faryshta/repos","events_url":"https://api.github.com/users/Faryshta/events{/privacy}","received_events_url":"https://api.github.com/users/Faryshta/received_events","type":"User","site_admin":false},"created_at":"2015-11-19T19:55:51Z","updated_at":"2015-11-19T19:55:51Z","body":"AttributeEnumTrait?"}}