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

Variant   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 6
eloc 11
c 1
b 0
f 0
dl 0
loc 52
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 3 1
A setImage() 0 3 1
A getImage() 0 3 1
A setProduct() 0 3 1
A getProduct() 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\ORM\Mapping as ORM;
7
8
/**
9
 * @ORM\Entity
10
 * @ORM\Table(name="variant_cascade")
11
 */
12
class Variant
13
{
14
    /**
15
     * @ORM\Id
16
     * @ORM\GeneratedValue
17
     * @ORM\Column(type="integer")
18
     */
19
    private $id;
0 ignored issues
show
introduced by
The private property $id is not used, and could be removed.
Loading history...
20
21
    /**
22
     * @ORM\Column(type="string", length=255)
23
     */
24
    private $name;
25
26
    /**
27
     * @ORM\ManyToOne(targetEntity=Product::class, inversedBy="variants")
28
     */
29
    private $product;
30
31
    /**
32
     * @ORM\OneToOne(targetEntity=Image::class, cascade={"persist"})
33
     */
34
    private $image;
35
36
    public function getName(): ?string
37
    {
38
        return $this->name;
39
    }
40
41
    public function setName(?string $name): void
42
    {
43
        $this->name = $name;
44
    }
45
46
    public function getProduct(): ?Product
47
    {
48
        return $this->product;
49
    }
50
51
    public function setProduct(Product $product): void
52
    {
53
        $this->product = $product;
54
    }
55
56
    public function getImage(): ?Image
57
    {
58
        return $this->image;
59
    }
60
61
    public function setImage(Image $image): void
62
    {
63
        $this->image = $image;
64
    }
65
}
66