class Inflector (View source)

Doctrine inflector has static methods for inflecting text

The methods in these classes are from several different sources collected across several different php projects and several different authors. The original author names and emails are not known

Methods

static string
tableize(string $word)

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

static string
classify(string $word)

Convert a word in to the format for a Doctrine class name. Converts 'table_name' to 'TableName'

static string
camelize(string $word)

Camelize a word. This uses the classify() method and turns the first character to lowercase

Details

static string tableize(string $word)

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

static string classify(string $word)

Convert a word in to the format for a Doctrine class name. Converts 'table_name' to 'TableName'

Parameters

string $word Word to classify

Return Value

string $word Classified word

static string camelize(string $word)

Camelize a word. This uses the classify() method and turns the first character to lowercase

Parameters

string $word

Return Value

string $word