Completed
Push — master ( d9d0f6...69ec8b )
by Tõnis
02:54
created

Language::rules()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 6
rs 9.4285
c 0
b 0
f 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 andmemasin\language\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
    /**
33
     * @param string $code
34
     * @return static
35
     */
36
    public abstract function findByCode($code);
37
}
38