ProviderLock::rules()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 31

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 31
ccs 0
cts 31
cp 0
rs 9.424
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
/**
4
 * @copyright  Copyright (c) Flipbox Digital Limited
5
 * @license    https://flipboxfactory.com/software/patron/license
6
 * @link       https://www.flipboxfactory.com/software/patron/
7
 */
8
9
namespace flipbox\patron\records;
10
11
use flipbox\craft\ember\helpers\ModelHelper;
12
use flipbox\craft\ember\records\ActiveRecord;
13
14
/**
15
 * @author Flipbox Factory <[email protected]>
16
 * @since 1.0.0
17
 *
18
 * @property int $providerId
19
 * @property int $pluginId
20
 */
21
class ProviderLock extends ActiveRecord
22
{
23
    use ProviderAttributeTrait;
24
25
    /**
26
     * The table alias
27
     */
28
    const TABLE_ALIAS = 'patron_provider_locks';
29
30
    /**
31
     * @inheritdoc
32
     */
33
    public function rules()
34
    {
35
        return array_merge(
36
            parent::rules(),
37
            [
38
                [
39
                    [
40
                        'pluginId'
41
                    ],
42
                    'number',
43
                    'integerOnly' => true
44
                ],
45
                [
46
                    [
47
                        'providerId',
48
                        'pluginId'
49
                    ],
50
                    'required'
51
                ],
52
                [
53
                    [
54
                        'pluginId'
55
                    ],
56
                    'safe',
57
                    'on' => [
58
                        ModelHelper::SCENARIO_DEFAULT
0 ignored issues
show
Deprecated Code introduced by
The constant flipbox\craft\ember\help...elper::SCENARIO_DEFAULT has been deprecated with message: Use `yii\base\Model::SCENARIO_DEFAULT`

This class constant has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the constant will be removed from the class and what other constant to use instead.

Loading history...
59
                    ]
60
                ]
61
            ]
62
        );
63
    }
64
}
65