SettingsLang.php
1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
    /**
     * Created by PhpStorm.
     * User: stes
     * Date: 16.02.18
     * Time: 11:05
     */
    
    namespace common\models;
    
    use artbox\core\models\Language;
    use yii2tech\filedb\ActiveRecord;
    
    class SettingsLang extends ActiveRecord
    {
        public static function fileName()
        {
            return 'settings_lang';
        }
        
        public function rules()
        {
            return [
                [
                    [
                        'settings_id',
                        'language_id',
                    ],
                    'integer',
                ],
                [
                    'about',
                    'string',
                ],
                
            ];
        }
        
        public function attributeLabels()
        {
            return [
                'about' => \Yii::t('core', 'About us'),
            ];
        }
    
        public function getLanguage()
        {
            return $this->hasOne(Language::className(), [ 'id' => 'language_id' ]);
        }
        
    } 
