Passed
Pull Request — 2.6 (#7750)
by
unknown
10:46
created

Car::getColor()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nop 0
dl 0
loc 3
rs 10
nc 1
1
<?php
2
namespace Doctrine\Tests\Models\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
     * @var string
37
     * @Column(name="color", type="text", nullable=false)
38
     */
39
    protected $color;
40
41
    /**
42
     * Car constructor.
43
     * @param Engine $engine
44
     * @param string $color
45
     */
46
    public function __construct(string $color, Engine $engine)
47
    {
48
        $this->color = $color;
49
        $this->engine = $engine;
50
    }
51
52
    /**
53
     * @return mixed
54
     */
55
    public function getId()
56
    {
57
        return $this->id;
58
    }
59
60
    /**
61
     * @return Engine
62
     */
63
    public function getEngine(): Engine
64
    {
65
        return $this->engine;
66
    }
67
68
    /**
69
     * @return string
70
     */
71
    public function getColor(): string
72
    {
73
        return $this->color;
74
    }
75
}
76