Vsch\TranslationManager\Manager::usingKey PHP Метод

usingKey() публичный Метод

public usingKey ( $namespace, $group, $key, null $locale = null, boolean $useLottery = false )
$namespace string
$group string
$key string
$locale null
$useLottery boolean
    public function usingKey($namespace, $group, $key, $locale = null, $useLottery = false)
    {
        if ($this->config(self::LOG_KEY_USAGE_INFO_KEY)) {
            $group = self::fixGroup($group);
            $group = $namespace && $namespace !== '*' ? $namespace . '::' . $group : $group;
            if (!in_array($group, $this->config(self::EXCLUDE_GROUPS_KEY))) {
                $lottery = 1;
                if ($useLottery && $this->config(self::MISSING_KEYS_LOTTERY_KEY) !== 1) {
                    $lottery = \Session::get($this->config(self::PERSISTENT_PREFIX_KEY) . self::LOTTERY_PERSISTENT_SUFFIX, '');
                    if ($lottery === '') {
                        $lottery = rand(1, $this->config(self::MISSING_KEYS_LOTTERY_KEY));
                        \Session::put($this->config(self::PERSISTENT_PREFIX_KEY) . self::LOTTERY_PERSISTENT_SUFFIX, $lottery);
                    }
                }
                if ($lottery === 1) {
                    $locale = $locale ?: $this->app['config']['app.locale'];
                    $this->cacheUsageInfo($group . '.' . $key, 1, $locale);
                }
            }
        }
    }