IdTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 35
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getId() 0 4 1
A setId() 0 6 1
1
<?php
2
3
namespace Mero\Bundle\BaseBundle\Entity\Field;
4
5
use Doctrine\ORM\Mapping as ORM;
6
7
/**
8
 * @author Rafael Mello <[email protected]>
9
 */
10
trait IdTrait
11
{
12
    /**
13
     * @var int Primary key
14
     *
15
     * @ORM\Id
16
     * @ORM\Column(type="integer")
17
     * @ORM\GeneratedValue(strategy="IDENTITY")
18
     */
19
    protected $id;
20
21
    /**
22
     * Return primary key identifier.
23
     *
24
     * @return int
25
     */
26
    public function getId()
27
    {
28
        return $this->id;
29
    }
30
31
    /**
32
     * Sets primary key identifier.
33
     *
34
     * @param int $id
35
     *
36
     * @return object
37
     */
38
    public function setId($id)
39
    {
40
        $this->id = $id;
41
42
        return $this;
43
    }
44
}
45