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

BaseEntity::get()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
crap 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
}