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

Engine::__construct()   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 1
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\OneToMany;
10
use Doctrine\ORM\Mapping\OneToOne;
11
use Doctrine\ORM\Mapping\Table;
12
use Doctrine\ORM\PersistentCollection;
13
14
/**
15
 * @Entity
16
 * @Table(name="engine")
17
 * @Cache(usage="READ_ONLY", region="engine")
18
 */
19
class Engine
20
{
21
    /**
22
     * @Id
23
     * @Column(type="integer")
24
     * @GeneratedValue(strategy="IDENTITY")
25
     */
26
    private $id;
27
28
    /**
29
     * @var Power
30
     * @Cache("READ_ONLY")
31
     * @OneToOne(targetEntity="Power", mappedBy="engine")
32
     */
33
    private $power;
34
35
    /**
36
     * @var PersistentCollection|null
37
     * @OneToMany(targetEntity="Car", mappedBy="engine")
38
     */
39
    private $car;
0 ignored issues
show
introduced by
The private property $car is not used, and could be removed.
Loading history...
40
41
    /**
42
     * @var string
43
     * @Column(name="model", type="string", nullable=false)
44
     */
45
    private $model;
46
47
    /**
48
     * Engine constructor.
49
     * @param string $model
50
     */
51
    public function __construct(string $model)
52
    {
53
        $this->model = $model;
54
    }
55
56
    /**
57
     * @return Power
58
     */
59
    public function getPower(): Power
60
    {
61
        return $this->power;
62
    }
63
64
    /**
65
     * @return mixed
66
     */
67
    public function getId()
68
    {
69
        return $this->id;
70
    }
71
72
    /**
73
     * @return string
74
     */
75
    public function getModel(): string
76
    {
77
        return $this->model;
78
    }
79
}
80