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

Catalog   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Test Coverage

Coverage 71.43%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
eloc 17
c 1
b 0
f 0
dl 0
loc 45
ccs 5
cts 7
cp 0.7143
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getId() 0 3 1
A setLastUpdated() 0 4 1
A getPath() 0 3 1
A setPath() 0 4 1
A getLastUpdated() 0 3 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 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