Passed
Push — master ( 039de6...202994 )
by
unknown
07:02
created

Thesaurus::getUsageCount()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Application\Model;
6
7
use Application\Traits\HasSite;
8
use Application\Traits\HasSiteInterface;
9
use Doctrine\ORM\Mapping as ORM;
10
use Ecodev\Felix\Model\Traits\HasName;
11
12
#[ORM\MappedSuperclass]
13
abstract class Thesaurus extends AbstractModel implements HasSiteInterface
14
{
15
    use HasName;
16
    use HasSite;
17
18
    #[ORM\Column(type: 'integer', options: ['default' => 0, 'unsigned' => true])]
19
    private int $usageCount = 0;
20
21
    /**
22
     * The nb of cards that use this thesaurus.
23
     *
24
     * Computed by DB triggers.
25
     */
26
    public function getUsageCount(): int
27
    {
28
        return $this->usageCount;
29
    }
30
}
31