Completed
Push — develop ( f1717b...d7e198 )
by
unknown
13:46
created

Reference   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
c 2
b 0
f 0
lcom 0
cbo 1
dl 0
loc 22
ccs 8
cts 8
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A fieldDefinitions() 0 7 1
A jsonSerialize() 0 7 1
1
<?php
2
/**
3
 * @author @jayS-de <[email protected]>
4
 * @created: 27.01.15, 14:53
5
 */
6
7
namespace Commercetools\Core\Model\Common;
8
9
/**
10
 * @package Commercetools\Core\Model\Common
11
 * @apidoc http://dev.sphere.io/http-api-types.html#reference
12
 * @method string getTypeId()
13
 * @method string getId()
14
 * @method Reference setTypeId(string $typeId = null)
15
 * @method Reference setId(string $id = null)
16
 * @method JsonObject getObj()
17
 * @method Reference setObj(JsonObject $obj = null)
18
 * @method string getKey()
19
 * @method Reference setKey(string $key = null)
20
 */
21
class Reference extends ResourceIdentifier
22
{
23
    const OBJ = 'obj';
24
25
    const TYPE_CLASS = '\Commercetools\Core\Model\Common\JsonObject';
26
27 73
    public function fieldDefinitions()
28
    {
29 73
        $fieldDefinitions = parent::fieldDefinitions();
30 73
        $fieldDefinitions[static::OBJ] = [static::TYPE => static::TYPE_CLASS];
31
32 73
        return $fieldDefinitions;
33
    }
34
35 3
    public function jsonSerialize()
36
    {
37 3
        $data = parent::jsonSerialize();
38 3
        unset($data['obj']);
39
40 3
        return $data;
41
    }
42
}
43