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

Language::tableName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
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\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