LazyRecord\Inflector::underscore PHP Method

underscore() public method

Returns the given camelCasedWord as an underscored_word.
public underscore ( string $camelCasedWord ) : string
$camelCasedWord string Camel-cased word to be "underscorized"
return string Underscore-syntaxed version of the $camelCasedWord
    public function underscore($camelCasedWord)
    {
        $_this =& self::getInstance();
        if (!($result = $_this->_cache(__FUNCTION__, $camelCasedWord))) {
            $result = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $camelCasedWord));
            $_this->_cache(__FUNCTION__, $camelCasedWord, $result);
        }
        return $result;
    }