SurveyLanguage   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 7
dl 0
loc 27
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A primaryKey() 0 3 1
A rules() 0 4 1
A tableName() 0 3 1
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
}