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

Product::getProductBundle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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