LifecycleDateTimeTrait   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 7
dl 0
loc 30
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getUpdatedAt() 0 3 1
A getCreatedAt() 0 3 1
A setUpdatedAt() 0 3 1
A setCreatedAt() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * (c) Christian Gripp <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Core23\Doctrine\Model\Traits;
13
14
use DateTime;
15
16
trait LifecycleDateTimeTrait
17
{
18
    /**
19
     * @var DateTime|null
20
     */
21
    protected $createdAt;
22
23
    /**
24
     * @var DateTime|null
25
     */
26
    protected $updatedAt;
27
28
    public function setCreatedAt(?DateTime $createdAt): void
29
    {
30
        $this->createdAt = $createdAt;
31
    }
32
33
    public function getCreatedAt(): ?DateTime
34
    {
35
        return $this->createdAt;
36
    }
37
38
    public function setUpdatedAt(?DateTime $updatedAt): void
39
    {
40
        $this->updatedAt = $updatedAt;
41
    }
42
43
    public function getUpdatedAt(): ?DateTime
44
    {
45
        return $this->updatedAt;
46
    }
47
}
48