Completed
Push — 10.1.x ( 42efc1...d78d9e )
by Tom
31s queued 16s
created

Field::getAlias()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
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 describe a field for GraphQL
12
 */
13
#[Attribute(Attribute::TARGET_PROPERTY | Attribute::IS_REPEATABLE)]
14
class Field
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 string|null $alias = null,
25
        protected string|null $description = null,
26
        protected string|null $type = null,
27
        protected string|null $hydratorStrategy = null,
28
        array $excludeFilters = [],
29
        array $includeFilters = [],
30
    ) {
31
        $this->includeFilters = $includeFilters;
32
        $this->excludeFilters = $excludeFilters;
33
    }
34
35
    public function getAlias(): string|null
36
    {
37
        return $this->alias;
38
    }
39
40
    public function getDescription(): string|null
41
    {
42
        return $this->description;
43
    }
44
45
    public function getGroup(): string
46
    {
47
        return $this->group;
48
    }
49
50
    public function getHydratorStrategy(): string|null
51
    {
52
        return $this->hydratorStrategy;
53
    }
54
55
    public function getType(): string|null
56
    {
57
        return $this->type;
58
    }
59
}
60