Luciano Andrade 8 年 前
コミット
887e0a4204
1 ファイル変更3 行追加1 行削除
  1. 3 1
      Model/ModelManager.php

+ 3 - 1
Model/ModelManager.php

@@ -486,7 +486,9 @@ class ModelManager implements ModelManagerInterface
      */
     protected function camelize($property)
     {
-        return preg_replace(array('/(^|_)+(.)/e', '/\.(.)/e'), array("strtoupper('\\2')", "'_'.strtoupper('\\1')"), $property);
+	return preg_replace_callback('/(^|[_. ])+(.)/', function ($match) {
+		return ('.' === $match[1] ? '_' : '') . strtoupper($match[2]);
+	}, $property);
     }
 
     /**