/** * Returns string with first char in lower case * @param string $string The original string * @return string The modified string */ public static function lowerFirstChar($string) { $firstChar = StringTool::substr($string, 0, 1); $otherChars = StringTool::substr($string, 1); return StringTool::lower($firstChar) . $otherChars; }
/** * Gets the name of the table from an element class string * @param string $elementClass The element class name * @return string The table name */ public static function getElementTableName($elementClass) { // Table format is "table_name", class name format is "ClassName" return StringTool::lower(preg_replace('/(?<=[a-z])([A-Z])/', '_$1', $elementClass)); }