Completed
Push — dev ( 65f7a2...84796b )
by Konstantin
02:56
created

Contact::linkLeadById()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 4
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
namespace linkprofit\AmoCRM\entities;
4
5
use linkprofit\AmoCRM\traits\CompanyLinkable;
6
use linkprofit\AmoCRM\traits\LeadsLinkable;
7
8
/**
9
 * Class Contact
10
 * @package linkprofit\AmoCRM\entities
11
 */
12 View Code Duplication
class Contact extends CustomizableEntity
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
13
{
14
    /**
15
     * @var integer id контакта, в которого будут вноситься изменения
16
     */
17
    public $id;
18
19
    /**
20
     * @var string Название контакта
21
     */
22
    public $name;
23
24
    /**
25
     * @var string Дата и время создания контакта
26
     */
27
    public $created_at;
28
29
    /**
30
     * @var string Дата и время обновления контакта. Обязательно при обновлении сущности.
31
     */
32
    public $updated_at;
33
34
    /**
35
     * @var integer id пользователя ответственного за контакт
36
     */
37
    public $responsible_user_id;
38
39
    /**
40
     * @var integer id пользователя создавшего контакт
41
     */
42
    public $created_by;
43
44
    /**
45
     * @var string Название новой компании. Параметр указывается для создания новой компании и привязке к ней контакта. Для привязки контакта к уже существующей компании, необходимо использовать параметр company_id
46
     */
47
    public $company_name;
48
49
    /**
50
     * @var string Теги, привязываемые к контакту. Задаются целостной строковой переменной, внутри строки перечисляются через запятую
51
     */
52
    public $tags;
53
54
    /**
55
     * @var string Покупатели, привязываемые к контакту. Перечисляются через запятую.
56
     */
57
    public $customers_id;
58
59
    use CompanyLinkable,
60
        LeadsLinkable;
61
62
    /**
63
     * @var array
64
     */
65
    protected $fieldList = [
66
        'id', 'name', 'created_at', 'updated_at',
67
        'responsible_user_id', 'created_by', 'company_name',
68
        'tags', 'leads_id', 'customers_id', 'company_id',
69
    ];
70
71
    /**
72
     * @param $array
73
     */
74 3
    public function set($array)
75
    {
76 3
        $this->setFromArray($this->fieldList, $array);
77
    }
78
}