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