Completed
Push — master ( 4b89b9...dd9abc )
by Jens
10:35
created

CartReference::fieldDefinitions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 7
Ratio 100 %

Code Coverage

Tests 4
CRAP Score 1
Metric Value
dl 7
loc 7
ccs 4
cts 4
cp 1
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * @author @jayS-de <[email protected]>
4
 * @created: 27.01.15, 18:22
5
 */
6
7
namespace Commercetools\Core\Model\Cart;
8
9
use Commercetools\Core\Model\Common\Context;
10
use Commercetools\Core\Model\Common\Reference;
11
12
/**
13
 * @package Commercetools\Core\Model\Cart
14
 * @link https://dev.commercetools.com/http-api-types.html#reference-types
15
 * @link https://dev.commercetools.com/http-api-projects-carts.html#cart
16
 * @method string getTypeId()
17
 * @method CartReference setTypeId(string $typeId = null)
18
 * @method string getId()
19
 * @method CartReference setId(string $id = null)
20
 * @method Cart getObj()
21
 * @method CartReference setObj(Cart $obj = null)
22
 * @method string getKey()
23
 * @method CartReference setKey(string $key = null)
24
 */
25
class CartReference extends Reference
26
{
27
    const TYPE_CART = 'cart';
28
    const TYPE_CLASS = '\Commercetools\Core\Model\Cart\Cart';
29
30
    /**
31
     * @param $id
32
     * @param Context|callable $context
33
     * @return CartReference
34
     */
35 4
    public static function ofId($id, $context = null)
36
    {
37 4
        return static::ofTypeAndId(static::TYPE_CART, $id, $context);
38
    }
39
}
40