ECommerceFeature   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 7
c 0
b 0
f 0
lcom 1
cbo 1
dl 0
loc 42
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getId() 0 3 1
A getDescription() 0 3 1
A setDescription() 0 3 1
A setProduct() 0 3 1
A removeProduct() 0 7 2
A getProduct() 0 3 1
1
<?php
2
3
namespace Doctrine\Tests\Models\ECommerce;
4
5
/**
6
 * Describes a product feature.
7
 *
8
 * @author Giorgio Sironi
9
 */
10
class ECommerceFeature
11
{
12
    /**
13
     */
14
    private $id;
15
16
    /**
17
     */
18
    private $description;
19
20
    /**
21
     */
22
    private $product;
23
24
    public function getId() {
25
        return $this->id;
26
    }
27
28
    public function getDescription() {
29
        return $this->description;
30
    }
31
32
    public function setDescription($description) {
33
        $this->description = $description;
34
    }
35
36
    public function setProduct(ECommerceProduct $product) {
37
        $this->product = $product;
38
    }
39
40
    public function removeProduct() {
41
        if ($this->product !== null) {
42
            $product = $this->product;
43
            $this->product = null;
44
            $product->removeFeature($this);
45
        }
46
    }
47
48
    public function getProduct() {
49
        return $this->product;
50
    }
51
}
52