Completed
Pull Request — master (#11)
by Volodymyr
08:11 queued 03:25
created

__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
/**
4
 * MIT License
5
 * For full license information, please view the LICENSE file that was distributed with this source code.
6
 */
7
8
namespace SprykerEco\Service\AkeneoPim\Dependencies\External\Api\Adapter\ReferenceEntity;
9
10
use Akeneo\PimEnterprise\ApiClient\AkeneoPimEnterpriseClientInterface;
11
12
class ReferenceEntityAttributeOptionApiAdapter implements ReferenceEntityAttributeOptionApiAdapterInterface
13
{
14
    /**
15
     * @var \Akeneo\PimEnterprise\ApiClient\AkeneoPimEnterpriseClientInterface
16
     */
17
    protected $akeneoPimClient;
18
19
    /**
20
     * @param \Akeneo\PimEnterprise\ApiClient\AkeneoPimEnterpriseClientInterface $akeneoPimClient
21
     */
22
    public function __construct(AkeneoPimEnterpriseClientInterface $akeneoPimClient)
23
    {
24
        $this->akeneoPimClient = $akeneoPimClient;
25
    }
26
27
    /**
28
     * @param string $referenceEntityCode Code of the reference entity
29
     * @param string $attributeCode Code of the attribute
30
     * @param string $attributeOptionCode Code of the attribute option
31
     *
32
     * @return array
33
     */
34
    public function get(string $referenceEntityCode, string $attributeCode, string $attributeOptionCode): array
35
    {
36
        return $this->akeneoPimClient
37
            ->getReferenceEntityAttributeOptionApi()
38
            ->get($referenceEntityCode, $attributeCode, $attributeOptionCode);
39
    }
40
41
    /**
42
     * @param string $referenceEntityCode Code of the reference entity
43
     * @param string $attributeCode Code of the attribute
44
     *
45
     * @return array
46
     */
47
    public function all(string $referenceEntityCode, string $attributeCode): array
48
    {
49
        return $this->akeneoPimClient
50
            ->getReferenceEntityAttributeOptionApi()
51
            ->all($referenceEntityCode, $attributeCode);
52
    }
53
}
54