Class Horde_Rdo_Inflector

Description

Rdo Inflector class.

Located in /Rdo/lib/Horde/Rdo/Inflector.php (line 13)


	
			
Variable Summary
 static array $_pluralizationRules
 static array $_singularEqualsPlural
 static array $_singularizationRules
Method Summary
 string mapperToEntity (Horde_Rdo_Mapper $mapper)
 string mapperToTable (Horde_Rdo_Mapper $mapper)
 string pluralize (string $word)
 string singularize (string $word)
 Horde_Rdo_Mapper tableToMapper (string $table)
Variables
static array $_pluralizationRules = array(
'/move$/i' => 'moves',
'/sex$/i' => 'sexes',
'/child$/i' => 'children',
'/man$/i' => 'men',
'/foot$/i' => 'feet',
'/person$/i' => 'people',
'/(quiz)$/i' => '$1zes',
'/^(ox)$/i' => '$1en',
'/(m|l)ouse$/i' => '$1ice',
'/(matr|vert|ind)ix|ex$/i' => '$1ices',
'/(x|ch|ss|sh)$/i' => '$1es',
'/([^aeiouy]|qu)ies$/i' => '$1y',
'/([^aeiouy]|qu)y$/i' => '$1ies',
'/(?:([^f])fe|([lr])f)$/i' => '$1$2ves',
'/sis$/i' => 'ses',
'/([ti])um$/i' => '$1a',
'/(buffal|tomat)o$/i' => '$1oes',
'/(bu)s$/i' => '$1ses',
'/(alias|status)$/i' => '$1es',
'/(octop|vir)us$/i' => '$1i',
'/(ax|test)is$/i' => '$1es',
'/s$/i' => 's',
'/$/' => 's',
)
(line 20)

Rules for pluralizing English nouns.

  • access: protected
static array $_singularEqualsPlural = array(
'aircraft',
'cannon',
'deer',
'equipment',
'fish',
'information',
'money',
'moose',
'rice',
'series',
'sheep',
'species',
'swine',
)
(line 90)
  • var: An array of words with the same singular and plural spellings.
  • access: protected
static array $_singularizationRules = array(
'/cookies$/i' => 'cookie',
'/moves$/i' => 'move',
'/sexes$/i' => 'sex',
'/children$/i' => 'child',
'/men$/i' => 'man',
'/feet$/i' => 'foot',
'/people$/i' => 'person',
'/databases$/i'=> 'database',
'/(quiz)zes$/i' => '\1',
'/(matr)ices$/i' => '\1ix',
'/(vert|ind)ices$/i' => '\1ex',
'/^(ox)en/i' => '\1',
'/(alias|status)es$/i' => '\1',
'/([octop|vir])i$/i' => '\1us',
'/(cris|ax|test)es$/i' => '\1is',
'/(shoe)s$/i' => '\1',
'/(o)es$/i' => '\1',
'/(bus)es$/i' => '\1',
'/([m|l])ice$/i' => '\1ouse',
'/(x|ch|ss|sh)es$/i' => '\1',
'/(m)ovies$/i' => '\1ovie',
'/(s)eries$/i' => '\1eries',
'/([^aeiouy]|qu)ies$/i' => '\1y',
'/([lr])ves$/i' => '\1f',
'/(tive)s$/i' => '\1',
'/(hive)s$/i' => '\1',
'/([^f])ves$/i' => '\1fe',
'/(^analy)ses$/i' => '\1sis',
'/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/i' => '\1\2sis',
'/([ti])a$/i' => '\1um',
'/(n)ews$/i' => '\1ews',
'/(.*)s$/i' => '\1',
)
(line 51)

Rules for singularizing English nouns.

  • access: protected
Methods
mapperToEntity (line 140)

Transform a mapper class to and entity class name.

  • return: A Horde_Rdo_Base concrete class name if the class exists, else null.
  • access: public
string mapperToEntity (Horde_Rdo_Mapper $mapper)
mapperToTable (line 128)

Transform a mapper instance to a database table name.

  • return: The database table name.
  • access: public
string mapperToTable (Horde_Rdo_Mapper $mapper)
  • Horde_Rdo_Mapper $mapper: The Mapper instance to get the database table name for.
pluralize (line 156)

Singular English word to pluralize.

  • return: Plural form of $word.
  • access: public
string pluralize (string $word)
  • string $word: Word to pluralize.
singularize (line 188)

Plural English word to singularize.

  • return: Singular form of $word.
  • access: public
string singularize (string $word)
  • string $word: Word to singularize.
tableToMapper (line 113)

Transform a table name to a mapper class name.

  • return: A new Mapper instance if it exists, else null.
  • access: public
Horde_Rdo_Mapper tableToMapper (string $table)
  • string $table: The database table name to look up.

Documentation generated on Sun, 30 Jan 2011 05:18:35 +0000 by phpDocumentor 1.4.3