Passed
Push — master ( 6e2a06...da0795 )
by Jens
14:26
created

ZoneReference::ofId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 2
crap 1
1
<?php
2
/**
3
 * @author @jenschude <[email protected]>
4
 */
5
6
namespace Commercetools\Core\Model\Zone;
7
8
use Commercetools\Core\Model\Common\Context;
9
use Commercetools\Core\Model\Common\Reference;
10
11
/**
12
 * @package Commercetools\Core\Model\Zone
13
 * @link https://docs.commercetools.com/http-api-types.html#reference-types
14
 * @link https://docs.commercetools.com/http-api-projects-zones.html#zone
15
 * @method string getTypeId()
16
 * @method ZoneReference setTypeId(string $typeId = null)
17
 * @method string getId()
18
 * @method ZoneReference setId(string $id = null)
19
 * @method Zone getObj()
20
 * @method ZoneReference setObj(Zone $obj = null)
21
 * @method string getKey()
22
 * @method ZoneReference setKey(string $key = null)
23
 */
24
class ZoneReference extends Reference
25
{
26
    const TYPE_ZONE = 'zone';
27
    const TYPE_CLASS = Zone::class;
28
29
    /**
30
     * @param $id
31
     * @param Context|callable $context
32
     * @return ZoneReference
33
     */
34 167
    public static function ofId($id, $context = null)
35
    {
36 167
        return static::ofTypeAndId(static::TYPE_ZONE, $id, $context);
37
    }
38
39
    /**
40
     * @param $key
41
     * @param Context|callable $context
42
     * @return ZoneReference
43
     */
44
    public static function ofKey($key, $context = null)
45
    {
46
        return static::ofTypeAndKey(static::TYPE_ZONE, $key, $context);
47
    }
48
}
49