Catalog::setLastUpdated()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 2
c 0
b 0
f 0
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
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
    {
28
        return $this->id;
29
    }
30
31 1
    public function getPath(): string
32
    {
33 1
        return $this->path;
34
    }
35
36 1
    public function setPath(string $path): CatalogInterface
37
    {
38 1
        $this->path = $path;
39 1
        return $this;
40
    }
41
42
    /**
43
     * Returns the date of the last catalog update
44
     */
45 1
    public function getLastUpdated(): ?DateTimeInterface
46
    {
47 1
        return $this->last_updated;
48
    }
49
50
    /**
51
     * Sets the date of the last catalog update
52
     */
53 1
    public function setLastUpdated(DateTimeInterface $value): CatalogInterface
54
    {
55 1
        $this->last_updated = $value;
56 1
        return $this;
57
    }
58
}
59