Completed
Push — develop ( c6f9f9...59e20d )
by Jens
09:32
created

ChannelReference   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

2 Methods

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