Product   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 1
dl 0
loc 24
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setProductBundle() 0 4 1
A getProductBundle() 0 4 1
A getProductBundleId() 0 8 2
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * Created by solutionDrive GmbH
7
 *
8
 * @copyright 2018 solutionDrive GmbH
9
 */
10
11
namespace solutionDrive\SyliusProductBundlesPlugin\Entity;
12
13
use Sylius\Component\Core\Model\Product as BaseProduct;
14
15
class Product extends BaseProduct
16
{
17
    /** @var ProductBundleInterface */
18
    private $productBundle;
19
20
    public function setProductBundle(ProductBundleInterface $productBundle): void
21
    {
22
        $this->productBundle = $productBundle;
23
    }
24
25
    public function getProductBundle(): ?ProductBundleInterface
26
    {
27
        return $this->productBundle;
28
    }
29
30
    public function getProductBundleId(): ?int
31
    {
32
        if (null === $this->productBundle) {
33
            return null;
34
        }
35
36
        return $this->productBundle->getId();
37
    }
38
}
39