public function retrieveCookieLanguage()
    {
        if (Yii::$app instanceof \yii\web\Application === false) {
            return;
        }
        if (Yii::$app->request->cookies->has('language_id')) {
            $language_id = intval(Yii::$app->request->cookies->get('language_id')->value);
            if (call_user_func(
                    [
                        $this->modelsMap['Language'],
                        'getById'
                    ],
                    $language_id
                ) !== null
            ) {
                $this->cookie_language_id = $language_id;
            }
        }
        if ($this->cookie_language_id === null) {
            $this->cookie_language_id = $this->language_id;

            Yii::$app->response->cookies->add(new Cookie([
                'name' => 'language_id',
                'value' => $this->cookie_language_id,
            ]));
        }
    }