Completed
Push — develop ( 524b9a...309d50 )
by Jens
09:14
created

AbstractUpdateByKeyRequest::getKey()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

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 4
ccs 0
cts 0
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
/**
3
 * @author @jayS-de <[email protected]>
4
 * @created: 26.01.15, 17:22
5
 */
6
7
namespace Commercetools\Core\Request;
8
9
use Psr\Http\Message\ResponseInterface;
10
use Commercetools\Core\Client\HttpMethod;
11
use Commercetools\Core\Client\JsonEndpoint;
12
use Commercetools\Core\Client\JsonRequest;
13
use Commercetools\Core\Error\Message;
14
use Commercetools\Core\Model\Common\Context;
15
use Commercetools\Core\Model\Common\ContextAwareInterface;
16
use Commercetools\Core\Response\ResourceResponse;
17
use Commercetools\Core\Error\UpdateActionLimitException;
18
19
/**
20
 * @package Commercetools\Core\Request
21
 */
22
abstract class AbstractUpdateByKeyRequest extends AbstractUpdateRequest
23
{
24
    /**
25
     * @return string
26
     */
27
    public function getKey()
28
    {
29
        return $this->getId();
30
    }
31
32
    /**
33
     * @param string $key
34
     * @return $this
35
     */
36
    public function setKey($key)
37
    {
38
        return $this->setId($key);
39
    }
40
41
    /**
42
     * @return string
43
     * @internal
44
     */
45 2
    protected function getPath()
46
    {
47 2
        return (string)$this->getEndpoint() . '/key=' . $this->getId();
48
    }
49
}
50