TaxonomyTerms::tableName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace nkostadinov\taxonomy\models;
4
5
use Yii;
6
7
/**
8
 * This is the model class for table "taxonomy_terms".
9
 *
10
 * @property integer $id
11
 * @property integer $taxonomy_id
12
 * @property string $term
13
 * @property string $total_count
14
 *
15
 * @property Taxonomy $taxonomy
16
 */
17
class TaxonomyTerms extends \yii\db\ActiveRecord
18
{
19
    /**
20
     * @inheritdoc
21
     */
22
    public static function tableName()
23
    {
24
        return 'taxonomy_terms';
25
    }
26
27
    /**
28
     * @inheritdoc
29
     */
30
    public function rules()
31
    {
32
        return [
33
            [['taxonomy_id', 'term', 'total_count'], 'required'],
34
            [['taxonomy_id', 'total_count'], 'integer'],
35
            [['term'], 'string', 'max' => 32]
36
        ];
37
    }
38
39
    /**
40
     * @inheritdoc
41
     */
42
    public function attributeLabels()
43
    {
44
        return [
45
            'id' => 'ID',
46
            'taxonomy_id' => 'Taxonomy ID',
47
            'term' => 'Term',
48
            'total_count' => 'Total Count',
49
        ];
50
    }
51
52
    /**
53
     * @return \yii\db\ActiveQuery
54
     */
55
    public function getTaxonomy()
56
    {
57
        return $this->hasOne(TaxonomyDef::className(), ['id' => 'taxonomy_id']);
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...
58
    }
59
}
60