You are here

public static function Inflector::reset in Plug 7

Clears Inflectors inflected value caches, and resets the inflection rules to the initial values.

Return value

void

5 calls to Inflector::reset()
InflectorTest::dataSampleWords in lib/doctrine/inflector/tests/Doctrine/Tests/Common/Inflector/InflectorTest.php
Singular & Plural test data. Returns an array of sample words.
InflectorTest::testCustomPluralRule in lib/doctrine/inflector/tests/Doctrine/Tests/Common/Inflector/InflectorTest.php
testCustomPluralRule method
InflectorTest::testCustomRuleWithReset in lib/doctrine/inflector/tests/Doctrine/Tests/Common/Inflector/InflectorTest.php
Test resetting inflection rules.
InflectorTest::testCustomSingularRule in lib/doctrine/inflector/tests/Doctrine/Tests/Common/Inflector/InflectorTest.php
testCustomSingularRule method
InflectorTest::testRulesClearsCaches in lib/doctrine/inflector/tests/Doctrine/Tests/Common/Inflector/InflectorTest.php
test that setting new rules clears the inflector caches.

File

lib/doctrine/inflector/lib/Doctrine/Common/Inflector/Inflector.php, line 245

Class

Inflector
Doctrine inflector has static methods for inflecting text.

Namespace

Doctrine\Common\Inflector

Code

public static function reset() {
  if (empty(self::$initialState)) {
    self::$initialState = get_class_vars('Inflector');
    return;
  }
  foreach (self::$initialState as $key => $val) {
    if ($key != 'initialState') {
      self::${$key} = $val;
    }
  }
}