Completed
Push — 10.2.x ( 90c228...695f22 )
by Tom
18s queued 16s
created

Entity::getHydratorNamingStrategy()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ApiSkeletons\Doctrine\ORM\GraphQL\Attribute;
6
7
use ApiSkeletons\Doctrine\ORM\GraphQL\Filter\Filters;
8
use Attribute;
9
10
/**
11
 * Attribute to define an entity for GraphQL
12
 */
13
#[Attribute(Attribute::TARGET_CLASS | Attribute::IS_REPEATABLE)]
14
final class Entity
15
{
16
    use ExcludeFilters;
17
18
    /**
19
     * @param Filters[] $excludeFilters
20
     * @param Filters[] $includeFilters
21
     */
22
    public function __construct(
23
        protected string $group = 'default',
24
        protected bool $byValue = true,
25
        protected int $limit = 0,
26
        protected string|null $description = null,
27
        private string|null $typeName = null,
28
        array $excludeFilters = [],
29
        array $includeFilters = [],
30
    ) {
31
        $this->includeFilters = $includeFilters;
32
        $this->excludeFilters = $excludeFilters;
33
    }
34
35
    public function getGroup(): string|null
36
    {
37
        return $this->group;
38
    }
39
40
    public function getByValue(): bool
41
    {
42
        return $this->byValue;
43
    }
44
45
    public function getLimit(): int
46
    {
47
        return $this->limit;
48
    }
49
50
    public function getDescription(): string|null
51
    {
52
        return $this->description;
53
    }
54
55
    public function getTypeName(): string|null
56
    {
57
        return $this->typeName;
58
    }
59
}
60