SurveyLanguage::rules()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace dameter\abstracts\models;
4
5
use dameter\abstracts\ManyToManyModel;
6
use dameter\abstracts\interfaces\Sortable;
7
8
/**
9
 * Class SurveyLanguage
10
 * @property integer $survey_language_id
11
 *
12
 * @package modules\abstracts\models
13
 * @author Tõnis Ormisson <[email protected]>
14
 */
15
class SurveyLanguage extends ManyToManyModel implements Sortable
16
{
17
    public static  $parentClass = BaseSurvey::class;
18
    public static  $childClass = Language::class;
19
20
    /** {@inheritdoc} */
21
    public function rules()
22
    {
23
        return array_merge(parent::rules(), [
24
            [['survey_id', 'language_id'], 'integer'],
25
        ]);
26
    }
27
28
    /**
29
     * {@inheritdoc}
30
     */
31
    public static function tableName()
32
    {
33
        return "survey_language";
34
    }
35
36
    /**
37
     * {@inheritdoc}
38
     */
39
    public static function primaryKey()
40
    {
41
        return ["survey_language_id"];
42
    }
43
44
45
}