@@ 134-137 (lines=4) @@ | ||
131 | /** @var ActiveRecord $owner */ |
|
132 | parent::attach($owner); |
|
133 | ||
134 | if (empty($this->languages) || !is_array($this->languages)) { |
|
135 | throw new InvalidConfigException('Please specify array of available languages for the ' . get_class($this) . ' in the ' |
|
136 | . get_class($this->owner) . ' or in the application parameters', 101); |
|
137 | } |
|
138 | ||
139 | if (array_values($this->languages) !== $this->languages) { //associative array |
|
140 | $this->languages = array_keys($this->languages); |
|
@@ 158-161 (lines=4) @@ | ||
155 | $this->currentLanguage = $this->getLanguageBaseName(Yii::$app->language); |
|
156 | } |
|
157 | ||
158 | if (empty($this->attributes) || !is_array($this->attributes)) { |
|
159 | throw new InvalidConfigException('Please specify multilingual attributes for the ' . get_class($this) . ' in the ' |
|
160 | . get_class($this->owner), 103); |
|
161 | } |
|
162 | ||
163 | if (!$this->langClassName) { |
|
164 | $this->langClassName = get_class($this->owner) . 'Lang'; |