public static function Inflector::tableize

Convert word in to the format for a Doctrine table name. Converts 'ModelName' to 'model_name'

Parameters

string $word Word to tableize:

Return value

string $word Tableized word

File

drupal/core/vendor/doctrine/common/lib/Doctrine/Common/Util/Inflector.php, line 46

Class

Inflector
Doctrine inflector has static methods for inflecting text

Namespace

Doctrine\Common\Util

Code

public static function tableize($word) {
  return strtolower(preg_replace('~(?<=\\w)([A-Z])~', '_$1', $word));
}