Completed
Pull Request — master (#15)
by Matthias
01:42
created

Product   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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