\FOFInflector
FOFInflector to pluralize and singularize English nouns.
Synopsis
class FOFInflector
{
- // methods
- private void __construct()
- public static void deleteCache()
- public static void addWord()
- public static string pluralize()
- public static string singularize()
- public static string camelize()
- public static string underscore()
- public static array explode()
- public static string implode()
- public static string humanize()
- public static string tableize()
- public static string classify()
- public static string variablize()
- public static boolean isSingular()
- public static boolean isPlural()
- public static string getPart()
Members
protected
- $_cache
—
array
Cache of pluralized and singularized nouns. - $_rules
—
array
Rules for pluralizing and singularizing of nouns.
Methods
public
- addWord() — Add a word to the cache, useful to make exceptions or to add words in other languages.
- camelize() — Returns given word as CamelCased.
- classify() — Converts a table name to its class name according to Koowa naming conventions.
- deleteCache()
- explode() — Convert any "CamelCased" word into an array of strings
- getPart() — Gets a part of a CamelCased word by index.
- humanize() — Returns a human-readable string from $word.
- implode() — Convert an array of strings into a "CamelCased" word.
- isPlural() — Check to see if an Enlish word is plural.
- isSingular() — Check to see if an English word is singular
- pluralize() — Singular English word to plural.
- singularize() — Plural English word to singular.
- tableize() — Converts a class name to its table name according to Koowa naming conventions.
- underscore() — Converts a word "into_it_s_underscored_version"
- variablize() — Returns camelBacked version of a string. Same as camelize but first char is lowercased.