API-Skeletons /
doctrine-orm-graphql
| 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 an association for GraphQL |
||
| 12 | */ |
||
| 13 | #[Attribute(Attribute::TARGET_PROPERTY | Attribute::IS_REPEATABLE)] |
||
| 14 | final class Association |
||
| 15 | { |
||
| 16 | use ExcludeFilters; |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 17 | |||
| 18 | /** |
||
| 19 | * @param Filters[] $excludeFilters |
||
| 20 | * @param Filters[] $includeFilters |
||
| 21 | */ |
||
| 22 | public function __construct( |
||
| 23 | private readonly string $group = 'default', |
||
| 24 | private readonly string|null $alias = null, |
||
| 25 | private readonly string|null $description = null, |
||
| 26 | private readonly int|null $limit = null, |
||
| 27 | private readonly string|null $criteriaEventName = null, |
||
| 28 | private readonly string|null $hydratorStrategy = null, |
||
| 29 | private readonly array $excludeFilters = [], |
||
| 30 | private readonly array $includeFilters = [], |
||
| 31 | ) { |
||
| 32 | } |
||
| 33 | |||
| 34 | public function getAlias(): string|null |
||
| 35 | { |
||
| 36 | return $this->alias; |
||
| 37 | } |
||
| 38 | |||
| 39 | public function getLimit(): int|null |
||
| 40 | { |
||
| 41 | return $this->limit; |
||
| 42 | } |
||
| 43 | |||
| 44 | public function getGroup(): string |
||
| 45 | { |
||
| 46 | return $this->group; |
||
| 47 | } |
||
| 48 | |||
| 49 | public function getHydratorStrategy(): string|null |
||
| 50 | { |
||
| 51 | return $this->hydratorStrategy; |
||
| 52 | } |
||
| 53 | |||
| 54 | public function getDescription(): string|null |
||
| 55 | { |
||
| 56 | return $this->description; |
||
| 57 | } |
||
| 58 | |||
| 59 | public function getCriteriaEventName(): string|null |
||
| 60 | { |
||
| 61 | return $this->criteriaEventName; |
||
| 62 | } |
||
| 63 | } |
||
| 64 |