Driver::addCars()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
dl 0
loc 4
rs 10
c 1
b 0
f 1
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace Khepin\Fixture\Document;
4
5
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
6
7
/**
8
 * @ODM\Document
9
 */
10
class Driver
11
{
12
    /**
13
     * @ODM\Id
14
     */
15
    private $id;
16
17
    /**
18
     * @ODM\ReferenceMany(targetDocument="Car")
19
     */
20
    private $cars = array();
21
22
    /**
23
     * @ODM\ReferenceOne(targetDocument="Car")
24
     */
25
    private $preferred_car;
26
27
    /**
28
     * @ODM\String
29
     * @var type
30
     */
31
    private $name;
32
33
    public function getId()
34
    {
35
        return $this->id;
36
    }
37
38
    public function addCars(Car $car)
39
    {
40
        $this->cars[] = $car;
41
    }
42
43
    public function getCars()
44
    {
45
        return $this->cars;
46
    }
47
48
    public function getName()
49
    {
50
        return $this->name;
51
    }
52
53
    public function setName($name)
54
    {
55
        $this->name = $name;
56
    }
57
58
    public function setPreferredCar($car)
59
    {
60
        $this->preferred_car = $car;
61
    }
62
63
    public function getPreferredCar()
64
    {
65
        return $this->preferred_car;
66
    }
67
}
68