Class Support_Inflector

Description

The Inflector class handles conversion of words between their singular and plural forms.

Located in /support/lib/Support/Inflector.php (line 28)


	
			
Variable Summary
 static mixed $inst
 mixed $ignore
 mixed $plurals
 mixed $singulars
Method Summary
 static string camelize (string $word, [bool $firstWordUpper = TRUE])
 static void getInstance ()
 static string humanize (string $word)
 static string pluralize (string $word)
 static string singularize (string $word)
 static string tableize (string $className)
 static string underscore (string $word)
 Support_Inflector __construct ()
 bool ignored (string $word)
 void pluralize_impl ( $word)
 void singularize_impl ( $word)
 void tableize_impl ( $className)
Variables
static mixed $inst = NULL (line 39)

Shared instance

  • access: protected
mixed $ignore (line 36)

Matches words which are the same in both the singular and plural forms

  • access: protected
mixed $plurals (line 33)

Plural conversions

  • access: protected
mixed $singulars (line 30)

Singular conversions

  • access: protected
Methods
static camelize (line 212)

Convert space or underscore separated words to a single mixed case name. For example, table_name becomes TableName. If $firstWordUpper is false, the first word is not converted to upper case (table_name would become tableName).

  • return: The converted word
  • access: public
string camelize (string $word, [bool $firstWordUpper = TRUE])
  • string $word: The word to convert
  • bool $firstWordUpper: Whether or not to upcase the first word (defaults to true).
static getInstance (line 117)

Return the shared class instance

  • access: protected
void getInstance ()
static humanize (line 264)

Convert underscore separated words to a space separated string of words with an initial capital letter.

  • return: The converted string
  • access: public
string humanize (string $word)
  • string $word: The string to convert
static pluralize (line 183)

Return the plural form of a word

  • access: public
string pluralize (string $word)
  • string $word: The word to pluralize
static singularize (line 195)

Return the singlar form of a word

  • access: public
string singularize (string $word)
  • string $word: The word to singularize
static tableize (line 251)

Convert a class name to a table name

  • access: public
string tableize (string $className)
  • string $className: The name to convert
static underscore (line 237)

Essentially the reverse of camelize. Converts a mixed case string to a lowercase underscore separated string of words.

  • return: The converted word
  • access: public
string underscore (string $word)
  • string $word: The word to convert
Constructor __construct (line 44)

Constructor

  • access: protected
Support_Inflector __construct ()
ignored (line 160)

Test a word to see if it matches a pattern on the ignore list

  • access: protected
bool ignored (string $word)
  • string $word: The word to test
pluralize_impl (line 126)

Implementation for pluralize

  • access: protected
void pluralize_impl ( $word)
  • $word
singularize_impl (line 141)

Implementation for singularize

  • access: protected
void singularize_impl ( $word)
  • $word
tableize_impl (line 172)

Implementation for tableize

  • access: protected
void tableize_impl ( $className)
  • $className

Documentation generated on Wed, 25 Apr 2012 09:46:43 -0700 by phpDocumentor 1.4.3