Completed
Push — master ( 8c95bb...199f9c )
by Nate
15:05
created

AbstractObject   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 51
ccs 0
cts 40
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B rules() 0 40 1
1
<?php
2
3
namespace flipbox\hubspot\records;
4
5
use flipbox\spark\helpers\RecordHelper;
6
use flipbox\spark\records\RecordWithId;
7
8
abstract class AbstractObject extends RecordWithId
9
{
10
    /**
11
     * The table alias
12
     */
13
    const TABLE_ALIAS = 'hubspot';
14
15
    /**
16
     * @inheritdoc
17
     */
18
    public function rules()
19
    {
20
        return array_merge(
21
            parent::rules(),
22
            [
23
                [
24
                    [
25
                        'elementId'
26
                    ],
27
                    'number',
28
                    'integerOnly' => true
29
                ],
30
                [
31
                    [
32
                        'elementId',
33
                        'hubspotId',
34
                    ],
35
                    'required'
36
                ],
37
                [
38
                    'hubspotId',
39
                    'unique',
40
                    'targetAttribute' => [
41
                        'elementId',
42
                        'hubspotId'
43
                    ]
44
                ],
45
                [
46
                    [
47
                        'elementId',
48
                        'hubspotId'
49
                    ],
50
                    'safe',
51
                    'on' => [
52
                        RecordHelper::SCENARIO_DEFAULT
53
                    ]
54
                ]
55
            ]
56
        );
57
    }
58
}
59