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

Engine   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 53
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getModel() 0 3 1
A getPower() 0 3 1
A getId() 0 3 1
A __construct() 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\OneToOne;
10
use Doctrine\ORM\Mapping\Table;
11
12
/**
13
 * @Entity
14
 * @Table(name="engine")
15
 * @Cache(usage="READ_ONLY", region="engine")
16
 */
17
class Engine
18
{
19
    /**
20
     * @Id
21
     * @Column(type="integer")
22
     * @GeneratedValue(strategy="IDENTITY")
23
     */
24
    private $id;
25
26
    /**
27
     * @var Power
28
     * @Cache("READ_ONLY")
29
     * @OneToOne(targetEntity="Power", mappedBy="engine")
30
     */
31
    private $power;
32
33
    /**
34
     * @var string
35
     * @Column(name="model", type="string", nullable=false)
36
     */
37
    private $model;
38
39
    /**
40
     * Engine constructor.
41
     * @param string $model
42
     */
43
    public function __construct(string $model)
44
    {
45
        $this->model = $model;
46
    }
47
48
    /**
49
     * @return Power
50
     */
51
    public function getPower(): Power
52
    {
53
        return $this->power;
54
    }
55
56
    /**
57
     * @return mixed
58
     */
59
    public function getId()
60
    {
61
        return $this->id;
62
    }
63
64
    /**
65
     * @return string
66
     */
67
    public function getModel(): string
68
    {
69
        return $this->model;
70
    }
71
}
72