Failed Conditions
Pull Request — master (#7046)
by Gabriel
14:57
created

DDC2084Test::loadFixture()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 8
nc 1
nop 0
dl 0
loc 14
rs 9.4285
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A MyEntity1::getMyEntity2() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\Tests\ORM\Functional\Ticket;
6
7
use Doctrine\ORM\Annotation as ORM;
8
9
/**
10
 * @ORM\Entity
11
 * @ORM\Table(name="DDC2084_ENTITY1")
12
 */
13
class MyEntity1
14
{
15
    /**
16
     * @ORM\Id
17
     * @ORM\OneToOne(targetEntity=MyEntity2::class)
18
     * @ORM\JoinColumn(name="entity2_id", referencedColumnName="id", nullable=false)
19
     */
20
    private $entity2;
21
22
    public function __construct(MyEntity2 $myEntity2)
23
    {
24
        $this->entity2 = $myEntity2;
25
    }
26
27
    public function setMyEntity2(MyEntity2 $myEntity2)
28
    {
29
        $this->entity2 = $myEntity2;
30
    }
31
32
    public function getMyEntity2()
33
    {
34
        return $this->entity2;
35
    }
36
}
37
38
/**
39
 * @ORM\Entity
40
 * @ORM\Table(name="DDC2084_ENTITY2")
41
 */
42
class MyEntity2
43
{
44
    /**
45
     * @ORM\Id
46
     * @ORM\Column(type="integer")
47
     * @ORM\GeneratedValue(strategy="AUTO")
48
     */
49
    private $id;
50
51
    /**
52
     * @ORM\Column
53
     */
54
    private $value;
55
56
    public function __construct($value)
57
    {
58
        $this->value = $value;
59
    }
60
61
    public function getId()
62
    {
63
        return $this->id;
64
    }
65
66
    public function getValue()
67
    {
68
        return $this->value;
69
    }
70
71
    public function setValue($value)
72
    {
73
        $this->value = $value;
74
    }
75
}
76