Completed
Push — master ( 3f2d2e...78eab5 )
by Jens
09:03
created

CustomObjectReference   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 15
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A ofId() 0 4 1
1
<?php
2
/**
3
 * @author @jayS-de <[email protected]>
4
 */
5
6
namespace Commercetools\Core\Model\CustomObject;
7
8
use Commercetools\Core\Model\Common\Context;
9
use Commercetools\Core\Model\Common\Reference;
10
11
/**
12
 * @package Commercetools\Core\Model\CustomObject
13
 * @link https://dev.commercetools.com/http-api-types.html#reference-types
14
 * @method string getTypeId()
15
 * @method CustomObjectReference setTypeId(string $typeId = null)
16
 * @method string getId()
17
 * @method CustomObjectReference setId(string $id = null)
18
 * @method string getKey()
19
 * @method CustomObjectReference setKey(string $key = null)
20
 * @method CustomObject getObj()
21
 * @method CustomObjectReference setObj(CustomObject $obj = null)
22
 */
23
class CustomObjectReference extends Reference
24
{
25
    const TYPE_CUSTOM_OBJECT = 'key-value-document';
26
    const TYPE_CLASS = '\Commercetools\Core\Model\CustomObject\CustomObject';
27
28
    /**
29
     * @param $id
30
     * @param Context|callable $context
31
     * @return CustomObjectReference
32
     */
33
    public static function ofId($id, $context = null)
34
    {
35
        return static::ofTypeAndId(static::TYPE_CUSTOM_OBJECT, $id, $context);
36
    }
37
}
38