Clear cache of pluralized, singularized and tableize when set rules.

Signed-off-by: Mark Story <mark@mark-story.com>
This commit is contained in:
Juan Basso 2010-04-21 14:49:59 -03:00 committed by Mark Story
parent 9053291fe4
commit bb0ff192f7

View file

@ -370,6 +370,11 @@ class Inflector {
$_this->{$var}[$rule] = array_merge($pattern, $_this->{$var}[$rule]); $_this->{$var}[$rule] = array_merge($pattern, $_this->{$var}[$rule]);
} }
unset($rules[$rule], $_this->{$var}['cache' . ucfirst($rule)], $_this->{$var}['merged'][$rule]); unset($rules[$rule], $_this->{$var}['cache' . ucfirst($rule)], $_this->{$var}['merged'][$rule]);
if ($type === 'plural') {
$_this->_pluralized = $_this->_tableize = array();
} elseif ($type === 'singular') {
$_this->_singularized = array();
}
} }
} }
$_this->{$var}['rules'] = array_merge($rules, $_this->{$var}['rules']); $_this->{$var}['rules'] = array_merge($rules, $_this->{$var}['rules']);