Completed
Push — master ( a6419d...fe0e5d )
by Tõnis
02:14
created

Language   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A rules() 0 6 1
A tableName() 0 3 1
A primaryKey() 0 3 1
1
<?php
2
3
namespace dameter\abstracts\models;
4
5
use dameter\abstracts\DActiveRecord;
6
7
/**
8
 * This is the model class for table "language".
9
 *
10
 * @property integer $language_id
11
 * @property string $code
12
 * @property string $name
13
 *
14
 * @package dameter\abstract\models
15
 * @author Tonis Ormisson <[email protected]>
16
 */
17
abstract class Language extends DActiveRecord
18
{
19
    /**
20
     * {@inheritdoc}
21
     */
22
    public function rules()
23
    {
24
        return [
25
            [['code', 'name'], 'required'],
26
            [['code'], 'string', 'max' => 16],
27
            [['name'], 'string', 'max' => 255]
28
        ];
29
    }
30
31
    /**
32
     * {@inheritdoc}
33
     */
34
    public static function tableName()
35
    {
36
        return "{{language}}";
37
    }
38
39
    /**
40
     * {@inheritdoc}
41
     */
42
    public static function primaryKey()
43
    {
44
        return ["language_id"];
45
    }
46
47
48
    /**
49
     * @param string $code
50
     * @return static
51
     */
52
    public abstract function findByCode($code);
53
}
54