File::rules()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 10
ccs 0
cts 9
cp 0
rs 9.9332
cc 1
nc 1
nop 0
crap 2
1
<?php
2
/**
3
 * HiPanel core package
4
 *
5
 * @link      https://hipanel.com/
6
 * @package   hipanel-core
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2014-2019, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hipanel\models;
12
13
use hipanel\base\ModelTrait;
14
15
/**
16
 * Class File.
17
 *
18
 * @property string type
19
 */
20
class File extends \hiqdev\hiart\ActiveRecord
21
{
22
    use ModelTrait;
23
24
    public function rules()
25
    {
26
        return [
27
            [['id', 'type_id', 'state_id', 'client_id', 'seller_id', 'object_id', 'size'], 'integer'],
28
            [['filename', 'md5', 'type', 'state', 'client', 'seller'], 'safe'],
29
            [['create_time', 'update_time', 'month'], 'safe'],
30
31
            [['url', 'filename'], 'string', 'on' => ['put']],
32
        ];
33
    }
34
}
35