255], ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'id' => 'ID', 'key' => 'Ключ', 'title' => 'Название', 'value' => 'Значение', ]; } /** * @param string|int $key * @return null|string */ public static function getValueByKey($key) { /** @var self $model */ $model = self::find()->where(['key' => $key])->select('value')->one(); if (!$model) { return null; } return $model->value; } }