Completed
Push — master ( 65f7a2...1565b3 )
by Konstantin
07:54 queued 01:51
created

BaseEntity   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 47
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 47
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A get() 0 6 1
A set() 0 4 1
1
<?php
2
3
namespace linkprofit\AmoCRM\entities;
4
5
use linkprofit\AmoCRM\traits\FieldList;
6
7
/**
8
 * Class BaseEntity
9
 * @package entities
10
 */
11
abstract class BaseEntity implements EntityInterface
12
{
13
    /**
14
     * @var integer id сущности
15
     */
16
    public $id;
17
18
    /**
19
     * @var string Дата и время создания сущности
20
     */
21
    public $created_at;
22
23
    /**
24
     * @var string Дата и время изменения сущности
25
     */
26
    public $updated_at;
27
28
    /**
29
     * @var integer id пользователя ответственного за сущность
30
     */
31
    public $responsible_user_id;
32
33
    /**
34
     * @var array
35
     */
36
    protected $fieldList = [];
37
38
    use FieldList;
39
40
    /**
41
     * @return array
42
     */
43 14
    public function get()
44
    {
45 14
        $fields = $this->getExistedValues($this->fieldList);
46
47 14
        return $fields;
48
    }
49
50
    /**
51
     * @param $array
52
     */
53 17
    public function set($array)
54
    {
55 17
        $this->setFromArray($this->fieldList, $array);
56
    }
57
}