TimestampableEntity::setUpdatedAt()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
namespace CallCenter\Bundle\CommonBundle\Traits;
4
5
use DateTime;
6
use Doctrine\ORM\Mapping as ORM;
7
use Gedmo\Mapping\Annotation as Gedmo;
8
9
trait TimestampableEntity
10
{
11
    /**
12
     * @var DateTime
13
     *
14
     * @Gedmo\Timestampable(
15
     *      on="create"
16
     * )
17
     * @ORM\Column(
18
     *      name="created_at",
19
     *      type="datetime"
20
     * )
21
     */
22
    protected $createdAt;
23
24
    /**
25
     * @var DateTime
26
     *
27
     * @Gedmo\Timestampable(
28
     *      on="update"
29
     * )
30
     * @ORM\Column(
31
     *      name="updated_at",
32
     *      type="datetime"
33
     * )
34
     */
35
    protected $updatedAt;
36
37
    /**
38
     * Sets createdAt.
39
     *
40
     * @param DateTime $createdAt
41
     *
42
     * @return $this
43
     */
44
    public function setCreatedAt(DateTime $createdAt)
45
    {
46
        $this->createdAt = $createdAt;
47
48
        return $this;
49
    }
50
51
    /**
52
     * Returns createdAt.
53
     *
54
     * @return DateTime
55
     */
56
    public function getCreatedAt()
57
    {
58
        return $this->createdAt;
59
    }
60
61
    /**
62
     * Sets updatedAt.
63
     *
64
     * @param DateTime $updatedAt
65
     *
66
     * @return $this
67
     */
68
    public function setUpdatedAt(DateTime $updatedAt)
69
    {
70
        $this->updatedAt = $updatedAt;
71
72
        return $this;
73
    }
74
75
    /**
76
     * Returns updatedAt.
77
     *
78
     * @return DateTime
79
     */
80
    public function getUpdatedAt()
81
    {
82
        return $this->updatedAt;
83
    }
84
}
85