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

Tag::setName()   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 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="tag_cascade")
12
 */
13
class Tag
14
{
15
    /**
16
     * @ORM\Id
17
     * @ORM\GeneratedValue
18
     * @ORM\Column(type="integer")
19
     */
20
    private $id;
21
22
    /**
23
     * @ORM\Column(type="integer", nullable=true)
24
     */
25
    private $prePersistedId;
26
27
    /**
28
     * @ORM\Column(type="string", length=255)
29
     */
30
    private $name;
31
32
    /**
33
     * @ORM\ManyToMany(targetEntity=Product::class, mappedBy="tags")
34
     */
35
    private $products;
36
37
    public function __construct()
38
    {
39
        $this->products = new ArrayCollection();
40
    }
41
42
    public function getId(): ?int
43
    {
44
        return $this->id;
45
    }
46
47
    public function getPrePersistedId(): ?int
48
    {
49
        return $this->prePersistedId;
50
    }
51
52
    public function setPrePersistedId(?int $prePersistedId): void
53
    {
54
        $this->prePersistedId = $prePersistedId;
55
    }
56
57
    public function getName(): ?string
58
    {
59
        return $this->name;
60
    }
61
62
    public function setName(?string $name): void
63
    {
64
        $this->name = $name;
65
    }
66
67
    public function getProducts(): Collection
68
    {
69
        return $this->products;
70
    }
71
}
72