Completed
Push — master ( fe66cd...3af1a2 )
by Konstantin
02:26
created

Contact   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 36
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A set() 0 4 1
A linkLeadById() 0 4 1
1
<?php
2
3
namespace linkprofit\AmoCRM\entities;
4
5
/**
6
 * Class Lead
7
 * @package linkprofit\AmoCRM\entities
8
 */
9
class Contact extends CustomizableEntity
10
{
11
    public $id;
12
    public $name;
13
    public $created_at;
14
    public $updated_at;
15
    public $responsible_user_id;
16
    public $created_by;
17
    public $company_name;
18
    public $tags;
19
    public $leads_id;
20
    public $customers_id;
21
    public $company_id;
22
23
    protected $fieldList = [
24
        'id', 'name', 'created_at', 'updated_at',
25
        'responsible_user_id', 'created_by', 'company_name',
26
        'tags', 'leads_id', 'customers_id', 'company_id',
27
    ];
28
29
    /**
30
     * @param $array
31
     */
32 2
    public function set($array)
33
    {
34 2
        $this->setFromArray($this->fieldList, $array);
35 2
    }
36
37
    /**
38
     * @param $id
39
     */
40 1
    public function linkLeadById($id)
41
    {
42 1
        $this->mergeStringToField('leads_id', $id);
43
    }
44
}