Completed
Pull Request — 2.6 (#7750)
by
unknown
06:39
created

Car   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 41
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getId() 0 3 1
A getEngine() 0 3 1
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