ProductTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 24
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setBrand() 0 3 1
A getBrand() 0 3 1
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