MutableDatablePostModelTrait::setDateModifiedGmt()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
ccs 0
cts 3
cp 0
crap 2
rs 10
c 1
b 0
f 0
1
<?php
2
3
namespace Leonidas\Library\System\Model\Abstracts\Post;
4
5
use DateTimeInterface;
6
use Leonidas\Contracts\System\Model\DatableInterface;
7
8
trait MutableDatablePostModelTrait
9
{
10
    use DatablePostModelTrait;
11
12
    public function setDate(DateTimeInterface $date): self
13
    {
14
        $this->post->post_date = $date->format(DatableInterface::DATE_FORMAT);
15
16
        return $this;
17
    }
18
19
    public function setDateGmt(DateTimeInterface $date): self
20
    {
21
        $this->post->post_date_gmt = $date->format(DatableInterface::DATE_FORMAT);
22
23
        return $this;
24
    }
25
26
    public function setDateModified(DateTimeInterface $date): self
27
    {
28
        $this->post->post_modified = $date->format(DatableInterface::DATE_FORMAT);
29
30
        return $this;
31
    }
32
33
    public function setDateModifiedGmt(DateTimeInterface $date): self
34
    {
35
        $this->post->post_modified_gmt = $date->format(DatableInterface::DATE_FORMAT);
36
37
        return $this;
38
    }
39
}
40