HarvestClient   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 71
Duplicated Lines 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 1
eloc 21
c 3
b 0
f 0
dl 0
loc 71
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A rules() 0 17 1
1
<?php
2
/**
3
 * SaaS Link plugin for Craft CMS 3.x
4
 *
5
 * @link      https://workingconcept.com
6
 * @copyright Copyright (c) 2018 Working Concept Inc.
7
 */
8
9
namespace workingconcept\saaslink\models\harvest;
10
11
use craft\base\Model;
12
13
/**
14
 * Harvest Client Model
15
 * https://help.getharvest.com/api-v2/clients-api/clients/clients/
16
 */
17
18
class HarvestClient extends Model
19
{
20
    // Properties
21
    // =========================================================================
22
23
    /**
24
     * @var integer Unique ID for the client.
25
     */
26
    public $id;
27
28
    /**
29
     * @var string A textual description of the client.
30
     */
31
    public $name;
32
33
    /**
34
     * @var boolean Whether the client is active or archived.
35
     */
36
    public $is_active;
37
38
    /**
39
     * @var string The physical address for the client.
40
     */
41
    public $address;
42
43
    /**
44
     * @var string The currency code associated with this client.
45
     */
46
    public $currency;
47
48
    /**
49
     * @var string Date and time the client was created.
50
     * TODO: convert to actual \DateTime
51
     */
52
    public $created_at;
53
54
    /**
55
     * @var string Date and time the client was last updated.
56
     * TODO: convert to actual \DateTime
57
     */
58
    public $updated_at;
59
60
    /**
61
     * @var string
62
     */
63
    public $statement_key;
64
65
66
    // Public Methods
67
    // =========================================================================
68
69
    /**
70
     * @inheritdoc
71
     */
72
    public function rules()
73
    {
74
        return [
75
            [[
76
                'id', 
77
             ], 'number', 'integerOnly' => true],
78
            [['id'], 'required'],
79
            [[
80
                'name', 
81
                'address', 
82
                'currency', 
83
                'created_at', 
84
                'updated_at', 
85
             ], 'string'],
86
            [[
87
                'is_active', 
88
             ], 'boolean'],
89
        ];
90
    }
91
92
}
93