Completed
Push — master ( cab61f...655000 )
by Matthias
11s
created

Product   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 2
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
namespace solutionDrive\SyliusProductBundlesPlugin\Entity;
6
7
use Sylius\Component\Core\Model\Product as BaseProduct;
8
9
class Product extends BaseProduct
10
{
11
    /** @var ProductBundleInterface */
12
    private $productBundle;
13
14
    public function setProductBundle(ProductBundleInterface $productBundle)
15
    {
16
        $this->productBundle = $productBundle;
17
    }
18
19
    public function getProductBundle(): ?ProductBundleInterface
20
    {
21
        return $this->productBundle;
22
    }
23
24
    public function getProductBundleId(): ?int
25
    {
26
        if (null === $this->productBundle) {
27
            return null;
28
        }
29
30
        return $this->productBundle->getId();
31
    }
32
}
33