Completed
Pull Request — master (#602)
by Tom
07:01
created

Product   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 0
dl 0
loc 51
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace DoctrineORMModuleTest\Assets\Entity;
6
7
use Doctrine\ORM\Mapping as ORM;
8
9
/**
10
 * @ORM\Entity
11
 * @ORM\Table(name="doctrine_orm_module_product")
12
 */
13
class Product
14
{
15
    /**
16
     * @ORM\Id
17
     * @ORM\Column(type="integer");
18
     * @ORM\GeneratedValue(strategy="AUTO")
19
     */
20
    protected int $id;
0 ignored issues
show
Bug introduced by
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected T_STRING, expecting T_FUNCTION or T_CONST
Loading history...
21
22
    /** @ORM\Column(type="string", nullable=true) */
23
    protected string $name;
24
25
    /**
26
     * @ORM\ManyToMany(targetEntity="Category")
27
     *
28
     * @var ?array
29
     */
30
    protected $categories;
31
32
    public function getId() : ?int
33
    {
34
        return $this->id;
35
    }
36
37
    public function setName(string $name) : self
38
    {
39
        $this->name = $name;
40
41
        return $this;
42
    }
43
44
    public function getName() : string
45
    {
46
        return $this->name;
47
    }
48
49
    /**
50
     * @param Category[] $categories
51
     */
52
    public function setCategories(array $categories) : self
53
    {
54
        $this->categories = $categories;
55
56
        return $this;
57
    }
58
59
    /**
60
     * @return Category[]
61
     */
62
    public function getCategories() : array
63
    {
64
        return $this->categories;
65
    }
66
}
67