Passed
Push — master ( 0416dc...1faf97 )
by Kevin
03:44
created

Brand::getId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Zenstruck\Foundry\Tests\Fixtures\Entity\Cascade;
4
5
use Doctrine\Common\Collections\ArrayCollection;
6
use Doctrine\Common\Collections\Collection;
7
use Doctrine\ORM\Mapping as ORM;
8
9
/**
10
 * @ORM\Entity
11
 * @ORM\Table(name="brand_cascade")
12
 */
13
class Brand
14
{
15
    /**
16
     * @ORM\Id
17
     * @ORM\GeneratedValue
18
     * @ORM\Column(type="integer")
19
     */
20
    private $id;
21
22
    /**
23
     * @ORM\Column(type="string", length=255)
24
     */
25
    private $name;
26
27
    /**
28
     * @ORM\OneToMany(targetEntity=Product::class, mappedBy="brand")
29
     */
30
    private $products;
31
32
    public function __construct()
33
    {
34
        $this->products = new ArrayCollection();
35
    }
36
37
    public function getId(): ?int
38
    {
39
        return $this->id;
40
    }
41
42
    public function getName(): ?string
43
    {
44
        return $this->name;
45
    }
46
47
    public function setName(?string $name): void
48
    {
49
        $this->name = $name;
50
    }
51
52
    public function getProducts(): Collection
53
    {
54
        return $this->products;
55
    }
56
}
57