Completed
Push — master ( 08d451...0978b6 )
by Valery
04:41 queued 10s
created

EntityTimestampableTrait   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 36
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getCreatedAt() 0 4 1
A setCreatedAt() 0 6 1
A getUpdatedAt() 0 4 1
A setUpdatedAt() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Entity\Traits;
6
7
use Doctrine\ORM\Mapping as ORM;
8
9
trait EntityTimestampableTrait
10
{
11
    /**
12
     * @ORM\Column(type="datetime", nullable=true, options={"default"="CURRENT_TIMESTAMP"})
13
     */
14
    private $createdAt;
15
16
    /**
17
     * @ORM\Column(type="datetime", nullable=true, options={"default"="CURRENT_TIMESTAMP"})
18
     */
19
    private $updatedAt;
20
21
    public function getCreatedAt(): ?\DateTimeInterface
22
    {
23
        return $this->createdAt;
24
    }
25
26
    public function setCreatedAt(?\DateTimeInterface $createdAt): self
27
    {
28
        $this->createdAt = $createdAt;
29
30
        return $this;
31
    }
32
33
    public function getUpdatedAt(): ?\DateTimeInterface
34
    {
35
        return $this->updatedAt;
36
    }
37
38
    public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
39
    {
40
        $this->updatedAt = $updatedAt;
41
42
        return $this;
43
    }
44
}
45