Test Failed
Push — main ( 1045ac...c9fe77 )
by Daniel
14:42
created

Catalog::setLastUpdated()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 2
c 0
b 0
f 0
dl 0
loc 4
ccs 0
cts 0
cp 0
rs 10
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Uxmp\Core\Orm\Model;
6
7
use DateTimeInterface;
8
use Doctrine\DBAL\Types\Types;
9
use Doctrine\ORM\Mapping as ORM;
10
use Uxmp\Core\Orm\Repository\CatalogRepository;
11
12
#[ORM\Entity(repositoryClass: CatalogRepository::class)]
13
#[ORM\Table(name: 'catalog')]
14
class Catalog implements CatalogInterface
15
{
16
    #[ORM\Column(type: Types::INTEGER)]
17
    #[ORM\Id, ORM\GeneratedValue(strategy: 'AUTO')]
18
    private int $id;
19
20
    #[ORM\Column(type: Types::STRING)]
21
    private string $path = '';
22
23
    #[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
24
    private ?DateTimeInterface $last_updated = null;
25
26
    public function getId(): int
27 1
    {
28
        return $this->id;
29 1
    }
30
31
    public function getPath(): string
32 1
    {
33
        return $this->path;
34 1
    }
35 1
36
    public function setPath(string $path): CatalogInterface
37
    {
38
        $this->path = $path;
39
        return $this;
40
    }
41
42
    /**
43
     * Returns the date of the last catalog update
44
     */
45
    public function getLastUpdated(): ?DateTimeInterface
46
    {
47
        return $this->last_updated;
48
    }
49
50
    /**
51
     * Sets the date of the last catalog update
52
     */
53
    public function setLastUpdated(DateTimeInterface $value): CatalogInterface
54
    {
55
        $this->last_updated = $value;
56
        return $this;
57
    }
58
}
59