ProductTrait::getBrand()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Loevgaard\SyliusBrandPlugin\Model;
6
7
use Doctrine\ORM\Mapping as ORM;
8
9
trait ProductTrait
10
{
11
    /**
12
     * @var BrandInterface
13
     *
14
     * @ORM\ManyToOne(targetEntity="\Loevgaard\SyliusBrandPlugin\Model\BrandInterface", cascade={"persist"}, fetch="EAGER", inversedBy="products")
15
     * @ORM\JoinColumn(name="brand_id", referencedColumnName="id", onDelete="SET NULL")
16
     */
17
    protected $brand;
18
19
    /**
20
     * @return BrandInterface|null
21
     */
22
    public function getBrand(): ?BrandInterface
23
    {
24
        return $this->brand;
25
    }
26
27
    /**
28
     * @param BrandInterface|null $brand
29
     */
30
    public function setBrand(?BrandInterface $brand): void
31
    {
32
        $this->brand = $brand;
33
    }
34
}
35