Completed
Push — develop ( f876c4...3b7fce )
by
unknown
10:26
created

Reference::setKey()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 2
1
<?php
2
/**
3
 * @author @ct-jensschulze <[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
 */
19
class Reference extends ResourceIdentifier
20
{
21
    const OBJ = 'obj';
22
23 65
    public function fieldDefinitions()
24
    {
25 65
        $fieldDefinitions = parent::fieldDefinitions();
26 65
        $fieldDefinitions[static::OBJ] = [static::TYPE => '\Commercetools\Core\Model\Common\JsonObject'];
27
28 65
        return $fieldDefinitions;
29
    }
30
31 3
    public function jsonSerialize()
32
    {
33 3
        $data = parent::jsonSerialize();
34 3
        unset($data['obj']);
35
36 3
        return $data;
37
    }
38
39
    /**
40
     * @internal
41
     * @return null
42
     */
43
    public function getKey()
44
    {
45
        return null;
46
    }
47
48
    /**
49
     * @internal
50
     * @param null $key
51
     * @return $this
52
     */
53
    public function setKey($key = null)
54
    {
55
        return $this;
56
    }
57
}
58