Completed
Push — master ( aef33f...952551 )
by Gallice
51s queued 10s
created

Entity::getLookups()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
ccs 2
cts 2
cp 1
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Tgallice\Wit\Model;
4
5
class Entity implements \JsonSerializable
6
{
7
    const LOOKUP_TRAIT = 'trait';
8
9
    const LOOKUP_KEYWORDS = 'keywords';
10
11
    /**
12
     * @var string
13
     */
14
    private $id;
15
16
    /**
17
     * @var array
18
     */
19
    private $values;
20
21
    /**
22
     * @var string
23
     */
24
    private $description;
25
26
    /**
27
     * @var string[]
28
     */
29
    private $lookups;
30
31
    /**
32
     * @param $id
33
     * @param array|EntityValue[] $values
34
     * @param string|null $description
35
     * @param string[] $lookups
36
     */
37 6
    public function __construct($id, array $values = [], $description = '', array $lookups = [Entity::LOOKUP_KEYWORDS])
38
    {
39 6
        $this->id = $id;
40 6
        $this->values = $values;
41 6
        $this->description = $description;
42 6
        $this->lookups = $lookups;
43 6
    }
44
45
    /**
46
     * @return string
47
     */
48 1
    public function getId()
49
    {
50 1
        return $this->id;
51
    }
52
53
    /**
54
     * @return null|string
55
     */
56 1
    public function getDescription()
57
    {
58 1
        return $this->description;
59
    }
60
61
    /**
62
     * @return array|EntityValue[]
63
     */
64 1
    public function getValues()
65
    {
66 1
        return $this->values;
67
    }
68
69
    /**
70
     * @return string[]
71
     */
72 1
    public function getLookups()
73
    {
74 1
        return $this->lookups;
75
    }
76
77
    /**
78
     * @return array
79
     */
80 1
    public function jsonSerialize()
81
    {
82
        return [
83 1
            'id' => $this->id,
84 1
            'values' => $this->values,
85 1
            'doc' => $this->description,
86 1
            'lookups' => $this->lookups,
87 1
        ];
88
    }
89
}
90