From 10e3ef44e75e2b4b1e28358fd3b557845460ce43 Mon Sep 17 00:00:00 2001 From: William DURAND Date: Fri, 2 Sep 2011 15:44:00 +0200 Subject: [PATCH] [Util] Added a PropelInflector class --- Util/PropelInflector.php | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Util/PropelInflector.php diff --git a/Util/PropelInflector.php b/Util/PropelInflector.php new file mode 100644 index 0000000..c9844cb --- /dev/null +++ b/Util/PropelInflector.php @@ -0,0 +1,31 @@ + + */ +class PropelInflector +{ + /** + * Camelize a word. + * Inspirated by https://github.com/doctrine/common/blob/master/lib/Doctrine/Common/Util/Inflector.php + * + * @param string $word The word to camelize. + * @return string + */ + public static function camelize($word) + { + return lcfirst(str_replace(" ", "", ucwords(strtr($word, "_-", " ")))); + } +}