Completed
Push — develop ( a97860...827a39 )
by Jens
06:38
created

CartRecalculateAction::fieldDefinitions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 7
ccs 0
cts 0
cp 0
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
crap 2
1
<?php
2
/**
3
 * @author @jayS-de <[email protected]>
4
 */
5
6
namespace Commercetools\Core\Request\Carts\Command;
7
8
use Commercetools\Core\Model\Common\Context;
9
use Commercetools\Core\Request\AbstractAction;
10
11
/**
12
 * @package Commercetools\Core\Request\Carts\Command
13
 * @link https://dev.commercetools.com/http-api-projects-carts.html#recalculate
14
 * @method string getAction()
15
 * @method CartRecalculateAction setAction(string $action = null)
16
 * @method bool getUpdateProductData()
17
 * @method CartRecalculateAction setUpdateProductData(bool $updateProductData = null)
18
 */
19
class CartRecalculateAction extends AbstractAction
20
{
21
    /**
22
     * @param array $data
23 3
     * @param Context|callable $context
24
     */
25 3
    public function __construct(array $data = [], $context = null)
26 3
    {
27 3
        parent::__construct($data, $context);
28
        $this->setAction('recalculate');
29
    }
30
31
    public function fieldDefinitions()
32
    {
33
        $definitions = parent::fieldDefinitions();
34
        $definitions['updateProductData'] = [static::TYPE => 'bool'];
35
36
        return $definitions;
37
    }
38
}
39