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

Product::setProductBundle()   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 1
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