TaxonomyDef::getTaxonomyTerms()   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".
9
 *
10
 * @property integer $id
11
 * @property string $name
12
 * @property string $class
13
 * @property string $created_at
14
 * @property string $total_count
15
 * @property string $migration
16
 *
17
 * @property TaxonomyTerms[] $taxonomyTerms
18
 */
19
class TaxonomyDef extends \yii\db\ActiveRecord
20
{
21
    /**
22
     * @inheritdoc
23
     */
24
    public static function tableName()
25
    {
26
        return 'taxonomy_def';
27
    }
28
29
    /**
30
     * @inheritdoc
31
     */
32
    public function rules()
33
    {
34
        return [
35
            [['name', 'class', 'data_table', 'ref_table'], 'required'],
36
            [['created_at', 'migration'], 'safe'],
37
            [['total_count'], 'integer'],
38
            [['name'], 'string', 'max' => 64],
39
            [['name'], 'unique']
40
        ];
41
    }
42
43
    /**
44
     * @inheritdoc
45
     */
46
    public function attributeLabels()
47
    {
48
        return [
49
            'id' => 'ID',
50
            'name' => 'Name',
51
            'class' => 'Class',
52
            'created_at' => 'Created At',
53
            'total_count' => 'Total Count',
54
        ];
55
    }
56
57
    /**
58
     * @return \yii\db\ActiveQuery
59
     */
60
    public function getTaxonomyTerms()
61
    {
62
        return $this->hasMany(TaxonomyTerms::className(), ['taxonomy_id' => '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...
63
    }
64
}
65