Passed
Pull Request — master (#181)
by Mathieu
03:46
created

Brand   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getName() 0 3 1
A getProducts() 0 3 1
A setName() 0 3 1
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;
0 ignored issues
show
introduced by
The private property $id is not used, and could be removed.
Loading history...
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 getName(): ?string
38
    {
39
        return $this->name;
40
    }
41
42
    public function setName(?string $name): void
43
    {
44
        $this->name = $name;
45
    }
46
47
    public function getProducts(): Collection
48
    {
49
        return $this->products;
50
    }
51
}
52