Completed
Push — master ( c22208...64acfb )
by Igor
04:17
created

Country::getRegion()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace app\models;
4
5
use Yii;
6
use app\models\query\CountryQuery;
7
8
/**
9
 * This is the model class for table "country".
10
 *
11
 * @property integer $country_id
12
 * @property string $title
13
 *
14
 * @property City[] $city
15
 * @property Region[] $regions
16
 */
17
class Country extends \yii\db\ActiveRecord
18
{
19
    /**
20
     * @inheritdoc
21
     */
22
    public static function tableName()
23
    {
24
        return 'country';
25
    }
26
27
    /**
28
     * @inheritdoc
29
     */
30
    public function rules()
31
    {
32
        return [
33
            ['title', 'string', 'max' => 60],
34
            ['title', 'unique'],
35
            ['title', 'required']
36
        ];
37
    }
38
39
    /**
40
     * @inheritdoc
41
     */
42
    public function attributeLabels()
43
    {
44
        return [
45
            'country_id' => Yii::t('app', 'Country'),
46
            'title' => Yii::t('app', 'Title'),
47
        ];
48
    }
49
50
    /**
51
     * @inheritdoc
52
     * @return CountryQuery
53
     */
54
    public static function find()
55
    {
56
        return new CountryQuery(get_called_class());
57
    }
58
}
59