Article   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 11
dl 0
loc 25
rs 10
c 1
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A behaviors() 0 8 1
A tableName() 0 3 1
A rules() 0 5 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: execut
5
 * Date: 12/19/17
6
 * Time: 5:49 PM
7
 */
8
9
namespace execut\import\example\models;
10
11
12
use yii\behaviors\TimestampBehavior;
13
use yii\db\ActiveRecord;
14
use yii\db\Expression;
15
16
class Article extends ActiveRecord
17
{
18
    public function behaviors()
19
    {
20
        return [
21
            'date' => [
22
                'class' => TimestampBehavior::class,
23
                'createdAtAttribute' => 'created',
24
                'updatedAtAttribute' => 'updated',
25
                'value' => new Expression('NOW()'),
26
            ],
27
        ];
28
    }
29
30
    public function rules()
31
    {
32
        return [
33
            [['article', 'example_brand_id'], 'required'],
34
            [['source'], 'safe'],
35
        ];
36
    }
37
38
    public static function tableName()
39
    {
40
        return 'example_articles';
41
    }
42
}