AccountInvalidationType   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 9
c 1
b 0
f 1
dl 0
loc 38
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A tableName() 0 3 1
A attributeLabels() 0 5 1
A rules() 0 5 1
A getAccounts() 0 3 1
1
<?php
2
3
namespace app\models;
4
5
use yii\db\ActiveRecord;
6
7
/**
8
 * This is the model class for table "account_invalidation_type".
9
 *
10
 * @property int $id
11
 * @property string $name
12
 *
13
 * @property Account[] $accounts
14
 */
15
class AccountInvalidationType extends ActiveRecord
16
{
17
    /**
18
     * {@inheritdoc}
19
     */
20
    public static function tableName()
21
    {
22
        return 'account_invalidation_type';
23
    }
24
25
    /**
26
     * {@inheritdoc}
27
     */
28
    public function rules()
29
    {
30
        return [
31
            [['name'], 'required'],
32
            [['name'], 'string', 'max' => 255],
33
        ];
34
    }
35
36
    /**
37
     * {@inheritdoc}
38
     */
39
    public function attributeLabels()
40
    {
41
        return [
42
            'id' => 'ID',
43
            'name' => 'Name',
44
        ];
45
    }
46
47
    /**
48
     * @return \yii\db\ActiveQuery
49
     */
50
    public function getAccounts()
51
    {
52
        return $this->hasMany(Account::class, ['invalidation_type_id' => 'id']);
53
    }
54
}
55