Created
November 4, 2010 15:07
-
-
Save Herzult/662592 to your computer and use it in GitHub Desktop.
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. - Martin Golding
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class UserGroup extends BaseUserGroup | |
{ | |
/** | |
* Overwrites the parent getName to return a translated string | |
* | |
* @return translated name as string | |
*/ | |
public function getName() | |
{ | |
return (sfContext::hasInstance()) ? sfContext::getInstance()->getI18N()->__(parent::_get('name')) : ''; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note that without a symfony context, the code fails silently, returning an empty string instead of the group name. Awesome.