Passed
Pull Request — master (#46)
by Paweł
02:52
created

Account::fields()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 17
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 15
nc 1
nop 0
dl 0
loc 17
rs 9.4285
c 0
b 0
f 0
1
<?php
2
/**
3
 * Created for IG Monitoring.
4
 * User: jakim <[email protected]>
5
 * Date: 06.05.2018
6
 */
7
8
namespace app\modules\api\v1\models;
9
10
11
use yii\behaviors\AttributeTypecastBehavior;
12
use yii\helpers\ArrayHelper;
13
14
class Account extends \app\models\Account
15
{
16
    public function behaviors()
17
    {
18
        return ArrayHelper::merge(parent::behaviors(), [
19
            'type' => [
20
                'class' => AttributeTypecastBehavior::class,
21
                'typecastAfterValidate' => false,
22
                'typecastAfterSave' => true,
23
                'typecastAfterFind' => true,
24
            ],
25
        ]);
26
    }
27
28
    public function fields()
29
    {
30
        return [
31
            'id',
32
            'uid',
33
            'username',
34
            'monitoring',
35
            'disabled',
36
            'name',
37
            'profile_pic_url',
38
            'full_name',
39
            'biography',
40
            'external_url',
41
            'instagram_id',
42
            'notes',
43
            'updated_at',
44
            'created_at',
45
        ];
46
    }
47
}