Passed
Push — master ( c14dbc...579f08 )
by Luís
12:22
created

ParentClass   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 21
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
1
<?php
2
3
namespace Doctrine\Tests\Models\ManyToManyPersister;
4
5
use Doctrine\Common\Collections\ArrayCollection;
6
use Doctrine\Common\Collections\Collection;
7
use Doctrine\ORM\Annotation as ORM;
8
9
/**
10
 * @ORM\Entity
11
 * @ORM\Table(name="manytomanypersister_parent")
12
 */
13
class ParentClass
14
{
15
    /**
16
     * @ORM\Id
17
     * @ORM\Column(name="id", type="integer")
18
     *
19
     * @var integer
20
     */
21
    public $id;
22
23
    /**
24
     * @ORM\ManyToMany(targetEntity=ChildClass::class, mappedBy="parents", orphanRemoval=true, cascade={"persist"})
25
     *
26
     * @var Collection|ChildClass[]
27
     */
28
    public $children;
29
30
    public function __construct(int $id)
31
    {
32
        $this->id       = $id;
33
        $this->children = new ArrayCollection();
34
    }
35
}
36