Links::attributeLabels()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 14

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 11
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 14
ccs 11
cts 11
cp 1
rs 9.7998
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace zacksleo\yii2\cms\models;
4
5
use Yii;
6
use zacksleo\yii2\cms\Module;
7
use yii\behaviors\TimestampBehavior;
8
9
/**
10
 * This is the model class for table "{{%links}}".
11
 *
12
 * @property integer $id
13
 * @property string $category
14
 * @property string $name
15
 * @property string $description
16
 * @property string $url
17
 * @property string $logo
18
 * @property integer $order
19
 * @property integer $created_at
20
 * @property integer $updated_at
21
 */
22
class Links extends \yii\db\ActiveRecord
23
{
24
    /**
25
     * @inheritdoc
26
     */
27 1
    public static function tableName()
28
    {
29 1
        return '{{%links}}';
30
    }
31
32
    /**
33
     * @inheritdoc
34
     */
35 2
    public function rules()
36
    {
37
        return [
38 2
            [['order', 'created_at', 'updated_at'], 'integer'],
39 2
            [['name', 'url'], 'required'],
40 2
            [['name', 'description', 'url', 'logo', 'category'], 'string', 'max' => 255],
41 2
        ];
42
    }
43
44
    /**
45
     * @inheritdoc
46
     */
47 1
    public function attributeLabels()
48
    {
49
        return [
50 1
            'id' => Module::t('links', 'ID'),
51 1
            'category' => Module::t('cms', 'Category'),
52 1
            'name' => Module::t('cms', 'Name'),
53 1
            'description' => Module::t('cms', 'Description'),
54 1
            'url' => Module::t('cms', 'Url'),
55 1
            'logo' => Module::t('cms', 'Logo'),
56 1
            'order' => Module::t('cms', 'Order'),
57 1
            'created_at' => Module::t('cms', 'Created At'),
58 1
            'updated_at' => Module::t('cms', 'Updated At'),
59 1
        ];
60
    }
61
62
    /**
63
     * @inheritdoc
64
     */
65 2
    public function behaviors()
66
    {
67
        return [
68
            'timestamp' => [
69 2
                'class' => TimestampBehavior::className(),
0 ignored issues
show
Deprecated Code introduced by
The method yii\base\BaseObject::className() has been deprecated with message: since 2.0.14. On PHP >=5.5, use `::class` instead.

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
70 2
            ],
71 2
        ];
72
    }
73
}
74