You are here

public static function Inflector::tableize in Plug 7

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

Parameters

string $word The word to tableize.:

Return value

string The tableized word.

File

lib/doctrine/inflector/lib/Doctrine/Common/Inflector/Inflector.php, line 210

Class

Inflector
Doctrine inflector has static methods for inflecting text.

Namespace

Doctrine\Common\Inflector

Code

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