Completed
Push — master ( 94fb91...3924c7 )
by Andrii
13:41
created

MailSettings::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
 * Server module for HiPanel
4
 *
5
 * @link      https://github.com/hiqdev/hipanel-module-server
6
 * @package   hipanel-module-server
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2015-2018, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hipanel\modules\server\models;
12
13
use Yii;
14
15
class MailSettings extends \hipanel\base\Model
16
{
17
    const SCENARIO_DEFAULT = 'dumb';
18
19
    public static function tableName()
20
    {
21
        return 'server';
22
    }
23
24
    public function rules()
25
    {
26
        return [
27
            [['id'], 'integer'],
28
            [['block_sending'], 'boolean'],
29
            [['per_hour_limit'], 'number'],
30
        ];
31
    }
32
33
    public static function primaryKey()
34
    {
35
        return ['id'];
36
    }
37
38
    public function scenarioActions()
39
    {
40
        return [
41
            'default' => 'set-mail-settings',
42
        ];
43
    }
44
45
    public function attributeLabels()
46
    {
47
        return array_merge(parent::attributeLabels(), [
48
            'per_hour_limit'   => Yii::t('hipanel:server', 'Mails per hour limit'),
49
            'block_sending' => Yii::t('hipanel:server', 'Block sending mail'),
50
        ]);
51
    }
52
}
53