Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[Util] Added a PropelInflector class

  • Loading branch information...
commit 10e3ef44e75e2b4b1e28358fd3b557845460ce43 1 parent 029a3ed
@willdurand willdurand authored
Showing with 31 additions and 0 deletions.
  1. +31 −0 Util/PropelInflector.php
View
31 Util/PropelInflector.php
@@ -0,0 +1,31 @@
+<?php
+
+/**
+ * This file is part of the PropelBundle package.
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ *
+ * @license MIT License
+ */
+
+namespace Propel\PropelBundle\Util;
+
+/**
+ * The Propel inflector class provides methods for inflecting text.
+ *
+ * @author William Durand <william.durand1@gmail.com>
+ */
+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, "_-", " "))));
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.