class Doctrine_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
classifyCallback(array $matches)

Callback function to classify a classname properly.

static boolean
seemsUtf8(string $string)

Check if a string has utf7 characters in it

static string
unaccent(string $string)

Remove any illegal characters, accents, etc.

static string
urlize(string $text)

Convert any passed string to a url friendly string. Converts 'My first blog post' to 'my-first-blog-post'

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 classifyCallback(array $matches)

Callback function to classify a classname properly.

Parameters

array $matches An array of matches from a pcre_replace call

Return Value

string $string A string with matches 1 and mathces 3 in upper case.

static boolean seemsUtf8(string $string)

Check if a string has utf7 characters in it

By bmorel at ssi dot fr

Parameters

string $string

Return Value

boolean $bool

static string unaccent(string $string)

Remove any illegal characters, accents, etc.

Parameters

string $string String to unaccent

Return Value

string $string Unaccented string

static string urlize(string $text)

Convert any passed string to a url friendly string. Converts 'My first blog post' to 'my-first-blog-post'

Parameters

string $text Text to urlize

Return Value

string $text Urlized text