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

Car::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\ManyToOne;
11
use Doctrine\ORM\Mapping\Table;
12
13
/**
14
 * @Entity
15
 * @Table(name="car")
16
 * @Cache(usage="READ_ONLY", region="car")
17
 */
18
class Car
19
{
20
    /**
21
     * @Id
22
     * @Column(type="integer")
23
     * @GeneratedValue(strategy="IDENTITY")
24
     */
25
    private $id;
26
27
    /**
28
     * @var Engine
29
     * @Cache("READ_ONLY")
30
     * @ManyToOne(targetEntity="Engine")
31
     * @JoinColumn(name="engine", referencedColumnName="id", nullable=false)
32
     */
33
    protected $engine;
34
35
    /**
36
     * Car constructor.
37
     * @param Engine $engine
38
     * @param string $color
39
     */
40
    public function __construct(Engine $engine)
41
    {
42
        $this->engine = $engine;
43
    }
44
45
    /**
46
     * @return mixed
47
     */
48
    public function getId()
49
    {
50
        return $this->id;
51
    }
52
53
    /**
54
     * @return Engine
55
     */
56
    public function getEngine(): Engine
57
    {
58
        return $this->engine;
59
    }
60
}
61