Contact::rules()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 11
ccs 0
cts 10
cp 0
rs 9.9
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
/**
3
 * HIAM module for MRDP database compatibility
4
 *
5
 * @link      https://github.com/hiqdev/hiam-mrdp
6
 * @package   hiam-mrdp
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2016, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hiam\mrdp\storage;
12
13
/**
14
 * Contact model.
15
 *
16
 * @property integer $obj_id PK
17
 * @property string  $first_name
18
 * @property string  $last_name
19
 * @property string  $email
20
 */
21
class Contact extends \yii\db\ActiveRecord
22
{
23
    /**
24
     * {@inheritdoc}
25
     */
26
    public function rules()
27
    {
28
        return [
29
            [['first_name', 'last_name'], 'trim'],
30
            [['first_name', 'last_name'], 'string', 'min' => 2, 'max' => 64],
31
32
            ['email', 'trim'],
33
            ['email', 'filter', 'filter' => 'strtolower'],
34
            ['email', 'email'],
35
        ];
36
    }
37
}
38