/** * Tests for the namespaceTail() function. * * @return void */ public function testNamespaceTail() { // No namespace $this->assertEquals('Foo', namespaceTail('Foo')); // A namespace $this->assertEquals('Baz', namespaceTail('Foo\\Bar\\Baz')); }
/** * Return the cache key name for the current table, language and domain. * * @return string */ protected function cacheKey() { if ($this->cacheKey === null) { $plugin = Inflector::underscore(namespaceRoot(__CLASS__)); $class = Inflector::underscore(namespaceTail(__CLASS__)); $connection = Inflector::underscore($this->_table->connection()->configName()); $table = Inflector::underscore($this->_table->table()); $this->cacheKey = $plugin . '_' . $class . '_' . $connection . '_' . $table; } return $this->cacheKey; }
/** * Return the cache key name for the current table, language and domain. * * @return string */ protected function cacheKey() { if ($this->cacheKey === null) { $plugin = Inflector::underscore(namespaceRoot(__CLASS__)); $class = Inflector::underscore(namespaceTail(__CLASS__)); $connection = Inflector::underscore($this->_table->connection()->configName()); $table = Inflector::underscore($this->_table->table()); $lang = strtolower(ini_get('intl.default_locale')); $domain = $this->config('domain'); $this->cacheKey = $plugin . '_' . $class . '_' . $connection . '_' . $table . '_' . $lang . '_' . $domain; } return $this->cacheKey; }