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

Variant   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 57
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 7
eloc 12
c 1
b 0
f 0
dl 0
loc 57
rs 10

7 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
A getId() 0 3 1
1
<?php
2
3
namespace Zenstruck\Foundry\Tests\Fixtures\Entity\Cascade;
4
5
use Doctrine\ORM\Mapping as ORM;
6
7
/**
8
 * @ORM\Entity
9
 * @ORM\Table(name="variant_cascade")
10
 */
11
class Variant
12
{
13
    /**
14
     * @ORM\Id
15
     * @ORM\GeneratedValue
16
     * @ORM\Column(type="integer")
17
     */
18
    private $id;
19
20
    /**
21
     * @ORM\Column(type="string", length=255)
22
     */
23
    private $name;
24
25
    /**
26
     * @ORM\ManyToOne(targetEntity=Product::class, inversedBy="variants")
27
     */
28
    private $product;
29
30
    /**
31
     * @ORM\OneToOne(targetEntity=Image::class, cascade={"persist"})
32
     */
33
    private $image;
34
35
    public function getId(): ?int
36
    {
37
        return $this->id;
38
    }
39
40
    public function getName(): ?string
41
    {
42
        return $this->name;
43
    }
44
45
    public function setName(?string $name): void
46
    {
47
        $this->name = $name;
48
    }
49
50
    public function getProduct(): ?Product
51
    {
52
        return $this->product;
53
    }
54
55
    public function setProduct(Product $product): void
56
    {
57
        $this->product = $product;
58
    }
59
60
    public function getImage(): ?Image
61
    {
62
        return $this->image;
63
    }
64
65
    public function setImage(Image $image): void
66
    {
67
        $this->image = $image;
68
    }
69
}
70