src/Didww/Utils/StringUtil.php
public static function camelCase($string, $lcfirst = true)
    {
        if ($lcfirst) return lcfirst(preg_replace_callback(array(
                        '/_(.?)/'
                    ), function ($matches) { return strtoupper($matches[1]); }, $string));
        return ucfirst(preg_replace_callback(array(
                        '(?:^|_)(.?)/'
                    ), function ($matches) { return strtoupper($matches[1]); }, $string));
    }
public static function camelCase($string, $lcfirst = true)
    {
        if ($lcfirst) return lcfirst(preg_replace_callback(array(
                        '/_(.?)/'
                    ), function ($matches) { return strtoupper($matches[1]); }, $string));
        return ucfirst(preg_replace_callback(array(
                        '(?:^|_)(.?)/'
                    ), function ($matches) { return strtoupper($matches[1]); }, $string));
    }
Camelize (or Pascalize) a string

@example <code>\Didww\Utils\StringUtil::camelCase('my_database_field', true);// => MyDatabaseField</code>

@param string $string The string to camelize
@param boolean $lcfirst [optional] First char must be lowercase ? Default is false
@return string           Camelized string