Completed
Pull Request — 2.6 (#7750)
by
unknown
09:24
created

Power::getEngine()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
namespace Doctrine\Tests\ORM\Functional\Ticket\Issue7735;
3
4
use Doctrine\ORM\Mapping\Cache;
5
use Doctrine\ORM\Mapping\Column;
6
use Doctrine\ORM\Mapping\Entity;
7
use Doctrine\ORM\Mapping\GeneratedValue;
8
use Doctrine\ORM\Mapping\Id;
9
use Doctrine\ORM\Mapping\JoinColumn;
10
use Doctrine\ORM\Mapping\OneToOne;
11
use Doctrine\ORM\Mapping\Table;
12
13
/**
14
 * @Entity
15
 * @Table(name="power")
16
 * @Cache(usage="READ_ONLY", region="power")
17
 */
18
class Power
19
{
20
    /**
21
     * @Id
22
     * @Column(type="integer")
23
     * @GeneratedValue(strategy="IDENTITY")
24
     */
25
    private $id;
0 ignored issues
show
introduced by
The private property $id is not used, and could be removed.
Loading history...
26
27
    /**
28
     * @var Engine
29
     * @OneToOne(targetEntity="Engine")
30
     * @Cache("READ_ONLY")
31
     * @JoinColumn(name="engine_id", referencedColumnName="id", onDelete="CASCADE")
32
     */
33
    protected $engine;
34
35
    /**
36
     * Power constructor.
37
     * @param int $horsePower
38
     * @param int $kilowatt
39
     * @param Engine $engine
40
     */
41
    public function __construct(Engine $engine)
42
    {
43
        $this->engine = $engine;
44
    }
45
46
    /**
47
     * @return Engine
48
     */
49
    public function getEngine(): Engine
50
    {
51
        return $this->engine;
52
    }
53
}
54