Strata\Utility\Inflector

Pluralize and singularize English words.

Inflector pluralizes and singularizes English nouns.
Used by CakePHP's naming conventions throughout the framework.

    Synopsis

    class Inflector {
    }

    Members

    protected

    • $_cache — array
      Method cache array.
    • $_initialState — array
      The initial state of Inflector so reset() works.
    • $_plural — array
      Plural inflector rules
    • $_singular — array
      Singular inflector rules
    • $_transliteration — array
      Default map of accented and special characters to ASCII characters
    • $_uninflected — array
      Words that should not be inflected

    Methods

    protected

    • _cache() — Cache inflected values, and return if already available

    public

    • camelize() — Returns the given lower_case_and_underscored_word as a CamelCased word.
    • classify() — Returns Cake model class name ("Person" for the database table "people".) for given database table.
    • humanize() — Returns the given underscored_word_group as a Human Readable Word Group.
    • pluralize() — Return $word in plural form.
    • reset() — Clears Inflectors inflected value caches. And resets the inflection rules to the initial values.
    • rules() — Adds custom inflection $rules, of either 'plural', 'singular' or 'transliteration' $type.
    • singularize() — Return $word in singular form.
    • slug() — Returns a string with all spaces converted to underscores (by default), accented characters converted to non-accented characters, and non word characters removed.
    • tableize() — Returns corresponding table name for given model $className. ("people" for the model class "Person").
    • underscore() — Returns the given camelCasedWord as an underscored_word.
    • variable() — Returns camelBacked version of an underscored string.