Completed
Push — master ( 2bb920...810e98 )
by Rafael
02:04
created

CreatedTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 2
Bugs 1 Features 0
Metric Value
wmc 2
c 2
b 1
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
/**
6
 * @author Rafael Mello <[email protected]>
7
 */
8
trait CreatedTrait
9
{
10
    /**
11
     * @var \DateTime Date created
12
     *
13
     * @ORM\Column(type="datetime", nullable=true)
14
     */
15
    protected $created;
16
17
    /**
18
     * Return created date if any.
19
     *
20
     * @return null|\DateTime
21
     */
22
    public function getCreated()
23
    {
24
        return $this->created;
25
    }
26
27
    /**
28
     * Sets date created.
29
     *
30
     * @param \DateTime $created
31
     *
32
     * @return object
33
     */
34
    public function setCreated(\DateTime $created)
35
    {
36
        $this->created = $created;
37
38
        return $this;
39
    }
40
}
41