CreatedTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
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 33
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getCreated() 0 4 1
A setCreated() 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 CreatedTrait
11
{
12
    /**
13
     * @var \DateTime Date created
14
     *
15
     * @ORM\Column(type="datetime", nullable=true)
16
     */
17
    protected $created;
18
19
    /**
20
     * Return created date if any.
21
     *
22
     * @return null|\DateTime
23
     */
24
    public function getCreated()
25
    {
26
        return $this->created;
27
    }
28
29
    /**
30
     * Sets date created.
31
     *
32
     * @param \DateTime $created
33
     *
34
     * @return object
35
     */
36
    public function setCreated(\DateTime $created)
37
    {
38
        $this->created = $created;
39
40
        return $this;
41
    }
42
}
43