Completed
Push — master ( 534891...2ac48c )
by Tõnis
02:15
created

BaseQuestionGroup   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 18
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A rules() 0 4 1
A getQuestions() 0 3 1
1
<?php
2
3
namespace dameter\abstracts\models;
4
use dameter\abstracts\WithLanguageSettingsModel;
5
use dameter\abstracts\WithSurveyModel;
6
use modules\abstracts\src\interfaces\Sortable;
7
8
9
/**
10
 * Class QuestionGroup
11
 * @property integer $question_group_id
12
 * @property integer $survey_id
13
 * @property integer $order
14
 *
15
 * @property BaseQuestion[] $questions
16
 *
17
 * @package dameter\abstracts\models
18
 * @author Tõnis Ormisson <[email protected]>
19
 */
20
abstract class BaseQuestionGroup extends WithLanguageSettingsModel implements Sortable
21
{
22
    /**
23
     * {@inheritdoc}
24
     */
25
    public function rules()
26
    {
27
        return array_merge(parent::rules(), [
28
            [['order'], 'integer'],
29
        ]);
30
    }
31
32
    /**
33
     * {@inheritdoc}
34
     */
35
    public function getQuestions()
36
    {
37
        return $this->hasMany(BaseQuestion::class);
38
    }
39
40
}