Completed
Push — master ( 810e98...a03780 )
by Rafael
16:20
created

IdTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0
Metric Value
wmc 2
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\BaseBundle\Entity\Field;
4
5
/**
6
 * @author Rafael Mello <[email protected]>
7
 */
8
trait IdTrait
9
{
10
    /**
11
     * @var int Primary key
12
     *
13
     * @ORM\Id
14
     * @ORM\Column(type="integer")
15
     * @ORM\GeneratedValue(strategy="IDENTITY")
16
     */
17
    protected $id;
18
19
    /**
20
     * Return primary key identifier.
21
     *
22
     * @return int
23
     */
24
    public function getId()
25
    {
26
        return $this->id;
27
    }
28
29
    /**
30
     * Sets primary key identifier.
31
     *
32
     * @param int $id
33
     *
34
     * @return object
35
     */
36
    public function setId($id)
37
    {
38
        $this->id = $id;
39
40
        return $this;
41
    }
42
}
43