OrderLineItem   A
last analyzed

Complexity

Total Complexity 9

Size/Duplication

Total Lines 121
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 72.72%

Importance

Changes 4
Bugs 1 Features 3
Metric Value
wmc 9
c 4
b 1
f 3
lcom 0
cbo 0
dl 0
loc 121
ccs 16
cts 22
cp 0.7272
rs 10

9 Methods

Rating   Name   Duplication   Size   Complexity  
A setProductId() 0 5 1
A getProductId() 0 4 1
A setQuantity() 0 5 1
A getQuantity() 0 4 1
A setPrice() 0 5 1
A getPrice() 0 4 1
A setTotal() 0 5 1
A getTotal() 0 4 1
A newInstance() 0 3 1
1
<?php
2
namespace Test\TestBundle\Document;
3
4
use Tpg\ExtjsBundle\Annotation as Extjs;
5
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
6
use JMS\Serializer\Annotation as JMS;
7
8
/**
9
 * @Extjs\Model(name="Test.document.OrderLineItem")
10
 * @ODM\EmbeddedDocument
11
 */
12
class OrderLineItem {
13
    /**
14
     * @ODM\Int
15
     * @JMS\Type("integer")
16
     */
17
    protected $productId;
18
19
    /**
20
     * @ODM\Int
21
     * @JMS\Type("integer")
22
     */
23
    protected $quantity;
24
25
    /**
26
     * @ODM\Float
27
     * @JMS\Type("double")
28
     */
29
    protected $price;
30
31
    /**
32
     * @ODM\Float
33
     * @JMS\Type("double")
34
     */
35
    protected $total;
36
37
    /**
38
     * Set productId
39
     *
40
     * @param int $productId
41
     * @return self
42
     */
43 25
    public function setProductId($productId)
44
    {
45 25
        $this->productId = $productId;
46 25
        return $this;
47
    }
48
49
    /**
50
     * Get productId
51
     *
52
     * @return int $productId
53
     */
54 2
    public function getProductId()
55
    {
56 2
        return $this->productId;
57
    }
58
59
    /**
60
     * Set quantity
61
     *
62
     * @param int $quantity
63
     * @return self
64
     */
65 25
    public function setQuantity($quantity)
66
    {
67 25
        $this->quantity = $quantity;
68 25
        return $this;
69
    }
70
71
    /**
72
     * Get quantity
73
     *
74
     * @return int $quantity
75
     */
76
    public function getQuantity()
77
    {
78
        return $this->quantity;
79
    }
80
81
    /**
82
     * Set price
83
     *
84
     * @param float $price
85
     * @return self
86
     */
87 25
    public function setPrice($price)
88
    {
89 25
        $this->price = $price;
90 25
        return $this;
91
    }
92
93
    /**
94
     * Get price
95
     *
96
     * @return float $price
97
     */
98
    public function getPrice()
99
    {
100
        return $this->price;
101
    }
102
103
    /**
104
     * Set total
105
     *
106
     * @param float $total
107
     * @return self
108
     */
109 25
    public function setTotal($total)
110
    {
111 25
        $this->total = $total;
112 25
        return $this;
113
    }
114
115
    /**
116
     * Get total
117
     *
118
     * @return float $total
119
     */
120
    public function getTotal()
121
    {
122
        return $this->total;
123
    }
124
125
    /**
126
     * Static class to create a new instance of OrderLineItem
127
     * @return OrderLineItem
128
     */
129 25
    public static function newInstance() {
130 25
        return new OrderLineItem();
131
    }
132
}
133