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

Product::getProductBundleId()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 0
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